3 Replies Latest reply on Oct 2, 2008 3:05 AM by Tim Fox

    Topic Statistics

    Tim Potter Newbie

      We are using JBossMQ and want to migrate to JBoss Messaging (JBoss AS 5.0 CR1). The issue we are having is that in JBoss MQ the Topic has a "MessageStatistics" attribute. In JBoss Messaging this attribute is not there. It is there for Queues but not Topics. We are using durable topics and want to see the depth of the Topic for each subscriber.

      There is an attribute named "MessageCounters", however, that object is not serializable and cannot be accessed remotely. MessageCounters does have a reference to the MessageStatistics that we need.

      ServerPeer has MessageStatistics for all destinations but I'm not sure that can be accessed remotely either.

      Does anybody know how to resolve this issue? Any help will be greatly appreciated.


        • 1. Re: Topic Statistics
          Tim Potter Newbie

          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");

          • 2. Re: Topic Statistics
            Yannan Lu Newbie

            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?



            • 3. Re: Topic Statistics
              Tim Fox Master

              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.