2 Replies Latest reply on Jun 22, 2009 6:19 AM by Tony Li

    How to retreive size of JMS queue (same jboss instance, sepa

    Tony Li Newbie

      Hi Folks,

      Under my [JBOSS_HOME]/server directory, i have four applications - app1, app2, app3 and monitoring. Within the monitoring application, i want to monitor the size of jms queues deployed on app1, app2 and app3.

      Below are the testing code i am using...

      
      String stringOjbectName = "mdh.mq.destination:service=Queue,name=testQueue";
      MBeanServer server = MBeanServerLocator.locateJBoss();
      ObjectName queueObjectName = ObjectName.getInstance(stringObjectName);
      QueueMBean queueMBean = (QueueMBean) MBeanServerInvocationHandler.newProxyInstance(
       server,queueObjectName,QueueMBean.class,false);
      
      int queueDepth = queueMBean.getQueueDepth();
      


      when run the monitoring app, i got error javax.management.InstanceNotFoundException: mdh.mq.destination:service=Queue,name=testQueue is not registered.

      I am using jboss 4.0.5. When i load jmx-console of app1, i can see testQueue is listed under domain mdh.mq.destination. Could anyone please shed some lights on this? Thanks in advnace