RabbitMQ: list queues on all vhosts with rabbitmqctl
Codemia Knowledge Hub ·
rabbitmqctl list_queues -p VHOST_NAME lists the queues in one virtual host. To cover all vhosts, run it once per vhost, which is easiest in a loop over rabbitmqctl list_vhosts. The management UI and HTTP API work too.
Each vhost is an isolated namespace with its own queues, exchanges, bindings and permissions. Vhosts work like namespaces. That isolation is what lets different applications, development environments or tenants operate independently inside one RabbitMQ instance, and it lets you segment broad operational domains on a single broker. Because permissions are controlled per vhost, you also get detailed access control.
Because of that isolation, rabbitmqctl list_queues works one vhost at a time. To monitor queue health, tune performance or troubleshoot across the whole broker, an administrator needs the queue information from each vhost.
Listing queues with rabbitmqctl
For one vhost:
rabbitmqctl is the command-line tool for RabbitMQ administration, but list_queues only covers the vhost you pass with -p. To list every vhost, run it once per vhost. You can automate that by looping over the output of list_vhosts:
The loop iterates over the vhosts and prints the queues in each one, with a heading per vhost. --silent drops the "Listing vhosts ..." banner and the name header row, which the loop would otherwise treat as vhost names.
Using the management UI
The RabbitMQ Management Interface is a web UI that ships with RabbitMQ and is one of the most user-friendly ways to browse queues. After logging in, an administrator can switch between vhosts to see the queues in each one.
Using the HTTP API
To list queues from scripts or applications, send a GET request to the HTTP API:
Replace vhost_name with your vhost. To cover all vhosts in one call, drop the vhost and request /api/queues, which lists every queue across all vhosts with a reduced set of fields.
What to look at in the listing
When you list queues, these fields are the most useful. Messages ready are waiting to be delivered to consumers, unacknowledged messages have been delivered but not yet acknowledged, and the total is the sum of the two.
| Metric | Description |
| Name | Identifier of the queue |
| State | Operational state of the queue, such as running or paused |
| Messages Ready | Number of messages ready for delivery |
| Messages Unacknowledged | Messages delivered but not yet acknowledged |
| Total Messages | Sum of ready and unacknowledged messages |
Related reading
- RabbitMQ Management Over HTTPS and Nginx
- RabbitMQ management returns 500 when trying to list queues
- Rabbitmq message arrival time stamp
- RabbitMQ messages remain Unacknowledged
- RabbitMQ user permission format
- Rails server is still running in a new opened docker container
- rabbitmq multiple consumers on a queue- only one get the message
- Rabbitmq or Gearman - choosing a jobs queue
System design interview problems on this topic
- Design a Distributed Messaging System: solution and walkthrough
- Design a Log Collection and Analysis System: solution and walkthrough
- Design an Ad Click Aggregation System: solution and walkthrough
- Design a Webhook Notification Service: solution and walkthrough

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseSystem Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.