1 Reply Latest reply on May 5, 2008 5:05 PM by Piergiuliano Bossi

    Monitoring the number of messages in a queue from the comman

    Piergiuliano Bossi Newbie

      Hello all,

      We are trying to monitor a queue status from the command line. In particular, we want to monitor the number of messages in the queue at any give time. Let's say that the queue name is XXXYYY. We are trying to use twiddle of course, but got stuck. As you can see below we are using jboss-4.0.5.GA (the examples are under windows, but we have the same behaviour under linux as well).

      C:\Program Files\jboss-4.0.5.GA\bin>twiddle query "jboss.mq.destination:*"
      [...]
      jboss.mq.destination:service=Queue,name=XXXYYY
      [...]
      
      C:\Program Files\jboss-4.0.5.GA\bin>twiddle get "jboss.mq.destination:service=Queue,name=XXXYYY"
      10:38:52,265 ERROR [Twiddle] Exec failed
      java.io.NotSerializableException: org.jboss.mq.server.MessageCounter
      [...]


      Because MessageCounter is not serializable we cannot get it's value. I guess we could write an JMX over RMI inspector but still, we have the circumvent the issue of dealing with an object that cannot be serialized and sent over the wire. Do you guys know any other MBean that we can monitor from the command line? Any other suggestions?

      Thanks,
      Giuliano

        • 1. Re: Monitoring the number of messages in a queue from the co
          Piergiuliano Bossi Newbie

          Replying to myself for the benefit of others: I can't make it to work over the net, at least between windows and linux machines, but the following works perfectly fine if run directly on the server.

          [root@fakehost bin]# ./twiddle.sh -u admin -p XXXXX get "jboss.mq.destination:service=Queue,name=QUEUE-XXX" QueueDepth
          QueueDepth=0
          [root@fakehost bin]# ./twiddle.sh -u admin -p XXXXX get "jboss.mq.destination:service=Queue,name=QUEUE-YYY" QueueDepth
          QueueDepth=0
          [root@fakehost bin]# ./twiddle.sh -u admin -p XXXXX get "jboss.mq.destination:service=Queue,name=QUEUE-YYY" SubscribersCount
          SubscribersCount=10
          [root@fakehost bin]# ./twiddle.sh -u admin -p XXXXX get "jboss.mq.destination:service=Queue,name=QUEUE-XXX" SubscribersCount
          SubscribersCount=10


          The attribute SubscribersCount tells you how many subscribers are listening on the queue, while QueueDepth tells you how many messages are currently in the queue.

          HTH
          Giuliano