Is there any way to list queues in rabbitmq via pika?
Asked Answered
C

2

18

I know that we can do this to list queue in a rabbitmq:

rabbitmqctl list_queues

but how can I do this via pika?

Clytemnestra answered 11/3, 2012 at 3:56 Comment(0)
R
24

No.

Pika is an AMQP library.

If you want to manage an MQ Broker, then you need an MQ Broker management tool. Fortunately, RabbitMQ comes with such a tool if you install a recent version of RabbitMQ such as 2.7.1 and you install the RabbitMQ management plugins. That gives you a web GUI as well as a RESTful API that you can use in your scripts.

But it's all outside of the scope of AMQP itself.

http://www.rabbitmq.com/management.html for the management plugin with a web GUI and http://www.rabbitmq.com/management-cli.html for a CLI type of interface.

Raffish answered 11/3, 2012 at 4:1 Comment(1)
so the AMQP protocal itself does not support 'listing queue', right? then, do rabbitmq provide this kind of api?Clytemnestra
P
0

While pika does not work, you can use the rabbitmq web api for this, e.g.

requests.get('https://' + hostname + "/api/queues", auth=('user', 'password'))

This is documented on your rabbitmq web frontend, just click HTTP API:

http api at bottom left of rabbitmq web control page

Plafker answered 18/4, 2024 at 8:41 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.