Thanks for link!
In JConsole under jboss.as.messaging I see my queue with ObjectName = "jboss.as:subsystem=messaging,hornetq-server=default,jms-queue=MyQueue" and under Operations there is exactly what I need: listMessageCounterAsJson().
How can I to obtain access to that method?
Tryied to use the following approach:
ObjectName on = new ObjectName("jboss.as:subsystem=messaging,hornetq-server=default,jms-queue=MyQueue"); org.hornetq.api.jms.management.JMSQueueControl queueControl = (JMSQueueControl) MBeanServerInvocationHandler.newProxyInstance(ManagementFactory.getPlatformMBeanServer(), on, JMSQueueControl.class, false); queueControl.listMessageCounter();
but at the last line NPE occurs.
JConsole also says that this queue hadled by org.jboss.as.controller.ModelController - do I need to research that class?
Have a look in JConsole at the class name for the MBean "jboss.as:subsystem=messaging,hornetq-server=default,jms-queue=MyQueue"
You need to create a proxy of org.jboss.as.controller.ModelController , not org.hornetq.api.jms.management.JMSQueueControl.
1 of 1 people found this helpful
You can also monitor the queues by using the native management API (see https://docs.jboss.org/author/display/AS7/The+native+management+API for reference). It's not exactly the "MBean way", but it's just another way around for management tasks on AS7.
Thx, Dima, this approach seems better than I looked for