-
2. Re: QueueControlMBean in AS7
mkind Jul 24, 2012 12:44 PM (in response to jbertram)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?
-
3. Re: QueueControlMBean in AS7
jmesnil Jul 25, 2012 5:28 AM (in response to mkind)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.
-
4. Re: QueueControlMBean in AS7
metallist Jul 25, 2012 2:57 PM (in response to mkind)1 of 1 people found this helpfulYou 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.
-
5. Re: QueueControlMBean in AS7
mkind Jul 25, 2012 3:25 PM (in response to metallist)Thx, Dima, this approach seems better than I looked for
-
6. Re: QueueControlMBean in AS7
jbertram Jul 25, 2012 3:35 PM (in response to mkind)1 of 1 people found this helpfulThis documentation is a bit more comprehensive and up-to-date: https://docs.jboss.org/author/display/AS71/The+native+management+API.