Does anyone know if there\'s a way to check the number of messages in a RabbitMQ queue from a client application?
I\'m using the .NET client library.
I was able to get the size/depth of queue from python program. 1. using py_rabbit
from pyrabbit.api import Client
cl = Client('10.111.123.54:15672', 'userid', 'password',5)
depth = cl.get_queue_depth('vhost', 'queue_name')
conn = kombu.Connection('amqp://userid:password@10.111.123.54:5672/vhost')
conn.connect()
client = conn.get_manager()
queues = client.get_queues('vhost')
for queue in queues:
if queue == queue_name:
print("tasks waiting in queue:"+str(queue.get("messages_ready")))
print("tasks currently running:"+str(queue.get("messages_unacknowledged")))
the ip address is just an example.