Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring RabbitMQ get all declared queues

I'm trying to get a list of all declared queues for a particular Virtual Host, using spring Rabbit libraries. But I can't see how you do it. There does exist a RabbitAdmin class which allows you to declare a queue, but you can't retrieve a list of existing queues.

Any ideas?

Thanks.

like image 342
Nick Avatar asked Mar 01 '13 11:03

Nick


2 Answers

You won't be able to do this from the Spring/Java client.

Instead there is a REST API which is part of the Management plugin http://www.rabbitmq.com/management.html

Take a look at http://hg.rabbitmq.com/rabbitmq-management/raw-file/rabbitmq_v3_0_2/priv/www/api/index.html for the full reference.

You will be interested in the section /api/queues to get all queues or /api/queues/vhost to get queues on a given vhost

like image 166
kzhen Avatar answered Sep 19 '22 11:09

kzhen


For those reading that in 2016 - Take a look on Hop (https://github.com/rabbitmq/hop), it aims to wrap RabbitMQ management API for Java.

like image 41
Anton Avatar answered Sep 20 '22 11:09

Anton