1 Reply Latest reply on Oct 29, 2008 3:42 AM by Tim Fox

    MessageCounter can't get total message count

    Ji-Woong Choi Newbie


      I am making a queue real-time graph for monitoring JBoss messaging Queue/Topic.
      JDK : JDK1.5.0_14
      JBM : JBoss Messaging 1.4.0 SP02

      I tried to connect jmx as like this :

      RMIAdaptor server = (RMIAdaptor) ctx
       // Get the MBeanInfo for the JNDIView MBean
       String targetName = "jboss.messaging.destination:service=" + type + ",name=" + name;
       ObjectName objName = ObjectName
       if (type.equalsIgnoreCase(QUEUE)) {
       QueueMBean queueMBean = (QueueMBean) MBeanServerInvocationHandler
       .newProxyInstance(server, objName,
       QueueMBean.class, false);
      currentMessageCount = queueMBean.getMessageCount();
       totalMessageCount = queueMBean.getMessageCounter().getCount();

      The problem is that queueMBean.getMessageCounter().getCount() method always return 0, even though I sent a lot of message to target queue.

      Is it bug? or not implement?