You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by MarcoB70 <be...@denic.de> on 2007/06/14 17:15:41 UTC

Getting the size of a Queue

I would like to access programmatically the size of a Queue without making
use of a QueueBrowser and scanning the elements it returns.
In the FAQ will a JMX approach recommendend (see
http://activemq.apache.org/how-do-i-find-the-size-of-a-queue.html), but I
would rather follow another way.
Other JMS implementations offer for example methods to get the messageCount
via a so-called Broker-Object.
Any hint?
Thanks in advance.

Marco
-- 
View this message in context: http://www.nabble.com/Getting-the-size-of-a-Queue-tf3922152s2354.html#a11121528
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Getting the size of a Queue

Posted by Jim Alateras <ji...@comware.com.au>.
Marco,

I am running an embedded broker and I use 
org.apache.activemq.brokerBrokerServer.getAdminView() to get access to 
the counters (enqueue, dequeue and queued count). These counters are at 
the broker level not the queue level though.

hope this helps.

cheers
</jima>
MarcoB70 wrote:
> I would like to access programmatically the size of a Queue without making
> use of a QueueBrowser and scanning the elements it returns.
> In the FAQ will a JMX approach recommendend (see
> http://activemq.apache.org/how-do-i-find-the-size-of-a-queue.html), but I
> would rather follow another way.
> Other JMS implementations offer for example methods to get the messageCount
> via a so-called Broker-Object.
> Any hint?
> Thanks in advance.
> 
> Marco