Check RabbitMQ queue size from client

You can actually retrieve this via the client.

When you perform a queue_declare operation, RabbitMQ returns a tuple with three values: (<queue name>, <message count>, <consumer count>). The passive argument to queue_declare allows you to check whether a queue exists without modifying the server state, so you can use queue_declare with the passive option to check the queue length.

Not sure about .NET, but in Python, it looks something like this:

name, jobs, consumers = chan.queue_declare(queue=queuename, passive=True)

Leave a Comment