You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Jigar Naik <ji...@interactcrm.com> on 2008/08/18 07:26:23 UTC

Total number of messages on a queue.

Hi,

is it possible to get a count of total number of messages in a queue ?

I want to do something like if the count exceed some limit than only start
processing.

Thanks 
Jigar Naik

-- 
View this message in context: http://www.nabble.com/Total-number-of-messages-on-a-queue.-tp19026156p19026156.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Total number of messages on a queue.

Posted by Bruce Snyder <br...@gmail.com>.
On Sun, Aug 17, 2008 at 11:26 PM, Jigar Naik <ji...@interactcrm.com> wrote:
>
> Hi,
>
> is it possible to get a count of total number of messages in a queue ?
>
> I want to do something like if the count exceed some limit than only start
> processing.

You an get a queue count via the use of JMX. I've provided an example
of this previously and it is available as an attachment on the
following discussion:

http://markmail.org/search/?q=activemq%20amqjmxexampletest#query:activemq%20amqjmxexampletest+page:1+mid:us7q7dgdinp2sfo6+state:results

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache ActiveMQ - http://activemq.org/
Apache Camel - http://activemq.org/camel/
Apache ServiceMix - http://servicemix.org/

Blog: http://bruceblog.org/