This content has been marked as final.
Show 4 replies
-
1. Re: queue statistics
marcobaroetto Feb 7, 2008 10:37 AM (in response to marcobaroetto)i got it:
try{ ObjectName queueObjectName = ObjectName.getInstance(stringObjectName); org.jboss.mq.server.jmx.QueueMBean queueMBean = (org.jboss.mq.server.jmx.QueueMBean) MBeanServerInvocationHandler.newProxyInstance( server, queueObjectName, org.jboss.mq.server.jmx.QueueMBean.class, false ); System.out.println("-------- QUEUE STATISTICS "+i+" ---------"); System.out.println("queue depth "+i+": " + queueMBean.getQueueDepth()); System.out.println("in process "+i+": " + queueMBean.getInProcessMessageCount()); System.out.println("scheduled "+i+": " + queueMBean.getScheduledMessageCount()); System.out.println("retries "+i+": " + queueMBean.getRecoveryRetries()); System.out.println("---------------------------------------------------"); }catch (Exception e){ System.out.println("cannot get depth of the queue: " + e.getMessage() ); }
-
2. Re: queue statistics
marcobaroetto Feb 7, 2008 11:01 AM (in response to marcobaroetto)i forgot this:
String domain = "jboss.mq.destination"; String service = "service=Queue"; String name = "name=MyQueue"; String stringObjectName = domain + ":" + service + "," + name; MBeanServer server = MBeanServerLocator.locateJBoss();
-
3. Re: queue statistics
kulmar Oct 25, 2008 3:22 PM (in response to marcobaroetto)is it ok? I have such problem:
java.lang.IllegalStateException: No 'jboss' MBeanServer found! at org.jboss.mx.util.MBeanServerLocator.locateJBoss(MBeanServerLocator.java:122)
-
4. Re: queue statistics
adrian.brock Nov 19, 2008 9:08 AM (in response to marcobaroetto)If you are not in the same JVM then you need to lookup the MBeanServerConnection
bound in jndi at jmx/rmi/RMIAdaptor