[rabbitmq-discuss] how get list of queues / check queue exists

Mark Pollack mpollack at vmware.com
Tue Jul 6 20:54:09 BST 2010


Hi,

As part of a soon to be released project from SpringSource, we will be providing a .NET client API to access the information you can get via Rabbitmqctl and other functions in the rabbitmq broker.   Jim Apperly from the rabbitmq team did the real hard work, I'll just be doing some minor changes.  I'll post back once some code is in git here git clone git://git.springsource.org/spring-amqp/spring-amqp-net.git

Mark



From: rabbitmq-discuss-bounces at lists.rabbitmq.com [mailto:rabbitmq-discuss-bounces at lists.rabbitmq.com] On Behalf Of Andrius Norkaitis
Sent: Monday, July 05, 2010 12:44 PM
To: rabbitmq-discuss at lists.rabbitmq.com
Subject: [rabbitmq-discuss] how get list of queues / check queue exists

Hi.

I have occasionally connected clients (subscribers) which bids to non-durable, exclusive, autodelete queue with their own ID.
I'm looking how to check which of the clients is online (queues with known ids is available) or not.

If I could get a list of available queues I could compare their names with ID to know which subscribers is online.
Also if there would be method to check is queue available I could iterate through my list  and check it.

Rabbitmqctl has method to get list of available queues, but I haven't found any way doing this using client.

I have founded one solution using QueueDeclare and passive flag:

bool QueueAvailable = false;
            try
            {
                var m = ch.QueueDeclare(routingKey, true, false, true, true, false, null);
                QueueAvailable = true;
            }
            catch { }

If there is no queue available I get an exception, but also this closes the connection so to check i.e. 500 queues I'll need to make a lot of new connections every time.

Maybe there is more elegant solution?

Best regards
Andrius Norkaitis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20100706/88cd1136/attachment.htm>


More information about the rabbitmq-discuss mailing list