3 Replies Latest reply on Sep 6, 2012 10:47 AM by Dan Checkoway

    How to get # of unconsumed messages in a queue

    Dan Checkoway Newbie



      I'm a relatively new HornetQ user.  I'm running an embedded instance of HornetQ in my app.  It's working well, but I have a requirement to monitor the number of unconsumed messages in a given queue, and I haven't figure out how to do that.


      I'm using JMX to access various Queue attributes such as DeliveringCount, MessageCount, and MessagesAdded.  As producers send new messages to the queue, I see all three of those counts going up.  But...the counts just continue incrementing upward, even after messages are consumed.


      I don't want a running count.  What I need is an instantaneous snapshot of the number of messages that have not yet been consumed.  Is this possible?


      Thanks in advance,