Skip to main content
Level 3
Jul 9, 2024 7:24 PM UTC
Solved

Read attributes from system/console/JMX page

Newbie to AEM. I have a requirement to read some attributes from the system/console/jmx page. On the JMX page we are looking for Domain org.apache.jackrabbit.oak, and from that domain, we need to read the values of some attributes like AttributeName=Statistics. how do i achieve this?. online i see many resources describing Mbeans creation and manipulation in JMX, but i dont think i need to create any Mbean, i just want to read some attributes on the JMX page. any directions would be appreciated. thank you.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
EstebanBustamante
EstebanBustamanteAccepted solution
Adobe Champion and Community Advisor
Jul 22, 2024 8:46 PM UTC

You just need to find a pattern that gives you all the instances you need while creating the `ObjectName`. In the code you posted, you are being too specific to get this item: "org.apache.jackrabbit.oak:id=\"Client c31f948f-5ec9-4bf4-9fb5-5b259018aa93\",type=\"Standby\",name=Status". 


Please check this as a reference: https://docs.oracle.com/javase/8/docs/api/javax/management/ObjectName.html

Esteban Bustamante

5 replies

EstebanBustamante
Adobe Champion and Community Advisor
Adobe Champion and Community Advisor
Jul 11, 2024 1:25 PM UTC
ASP_CorpAuthor
Level 3
Jul 22, 2024 8:18 PM UTC

Hi, Esteban, thanks for the direction. it is working now. but i have another problem. For the JMX cold sync Mbean, it has multiple instances. how do i get all the instances? for example if you go the JMX page and search by "standby", you will get multiple instances shown in the picture. how do i get the multiple instances? when i do 

ObjectName objectName = new ObjectName("org.apache.jackrabbit.oak:id=\"Client c31f948f-5ec9-4bf4-9fb5-5b259018aa93\",type=\"Standby\",name=Status"); i get the instance with given client ID. but if there are multiple instances with corresponding multiple clients, how do i get all the instances?
Translate
EstebanBustamante
Adobe Champion and Community Advisor
EstebanBustamanteAdobe Champion and Community AdvisorAccepted solution
Adobe Champion and Community Advisor
Jul 22, 2024 8:46 PM UTC

You just need to find a pattern that gives you all the instances you need while creating the `ObjectName`. In the code you posted, you are being too specific to get this item: "org.apache.jackrabbit.oak:id=\"Client c31f948f-5ec9-4bf4-9fb5-5b259018aa93\",type=\"Standby\",name=Status". 


Please check this as a reference: https://docs.oracle.com/javase/8/docs/api/javax/management/ObjectName.html

Translate
Esteban Bustamante
kautuk_sahni
Level 9
Jul 23, 2024 7:05 PM UTC

@asp_corp Did you find the suggestion helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!

Translate
Kautuk Sahni