I figured out a way to get what I needed. I was indeed able to retrieve the ServerPeer MXBean and then get the "MessageStatistics" attribute from it.
Here's the code I used in case someone is looking for it:
MBeanServerConnection server = (MBeanServerConnection) context.lookup("jmx/invoker/HttpAdaptor"); ObjectName serverPeerName = new ObjectName("jboss.messaging:service=ServerPeer"); ArrayList<MessageStatistics> attr = (ArrayList<MessageStatistics>) server.getAttribute(serverPeerName, "MessageStatistics");
I am having same issues. Once I migrated from JBossMQ to JBM, the stats on web-console have goneon both queues and topics. Does anyone know how to fix the web-console problem?
I am also thinking about writing a code to query the stats. Your code fragment is great. Is it possible for you to post a complete code ready to compile?
I don't really understand what your problem is.
JBM 1.4 should support all equivalent JMX functionality to JBoss MQ. See user guide for more info.