[rabbitmq-discuss] Queue info

Ying He yhe at usatech.com
Thu Feb 28 14:42:25 GMT 2008


Hi, Thanks for your reply.

I was running rabbitmq-server.bat and I do have some queues with
producers and consumers and they are working fine running in the
backgroud. However this command does not show me the right info, when I
start in another cmd 

C:\Program Files\erl5.5.5\bin>erl -sname yhe -remsh rabbit at localhost
Eshell V5.5.5  (abort with ^G)
(yhe at yhe)1> rabbit_amqqueue:stat_all().
** exited: {aborted,{no_exists,[amqqueue,[{'$1',[],['$1']}]]}} **

Please advise. Anything I did wrong? 'yhe' is the username.

As to the management interface, it will be good to see the number of
messages that has been through the queue and the number of messages that
still sit on the queue and error log for failure of delivery etc( this
could be optional)

Best,
ying

-----Original Message-----
From: Tony Garnock-Jones [mailto:tonyg at lshift.net] 
Sent: Thursday, February 28, 2008 2:15 AM
To: Ying He
Cc: rabbitmq-discuss at lists.rabbitmq.com
Subject: Re: [rabbitmq-discuss] Queue info

Hi Ying,

Ying He wrote:
> Is there any way in RabbitMQ server for the admin to check for
example:
> How many queues are currently in the system?
> How many messages that each one has processed and each one still holds

> waiting for the consumer to process?

There is an undocumented way of doing this. If you start the broker by 
running rabbitmq-server, then you end up at an erlang shell (if you 
don't see the prompt, tap enter to make it reprint it). If you have the 
broker running in the background, you need to attach an erlang shell to 
it, with a command along the lines of "erl -sname temp -remsh 
rabbit at yourmachine", running as the same user as the rabbit server.

At the erlang prompt, type "rabbit_amqqueue:stat_all().", which will 
produce a brief report on the status of the queues in the system. This 
tells you how many there are, how many consumers are listening on each, 
and how many messages are backlogged on each. There is no indication of 
how many messages have been through the queues yet. For example:

(rabbit at walk)1> rabbit_amqqueue:stat_all().
[{ok,{resource,<<"/">>,queue,<<"bar">>},0,1},
  {ok,{resource,<<"/">>,queue,<<"foo">>},0,1}]

The example shows two queues, "foo" and "bar", each with a single 
consumer attached (in fact a LogTail.exe instance from our .NET client),

and neither with any messages waiting to be consumed. The result of the 
stat_all() call is a list of {status, fully-qualified-queue-name, 
message-queue-length, consumer-count} tuples.

Regards,
   Tony





More information about the rabbitmq-discuss mailing list