rabbitmqadmin list: Inspect Queues and Bindings
rabbitmqadmin list queues name messages prints each queue and its message count over the management HTTP API, a quick assertion for CI.
After a test produces messages, list queues shows the resulting depth. It is also the fastest way to confirm your declare steps created the topology you expected.
What it does
rabbitmqadmin list <object> prints rows for queues, exchanges, bindings, connections, or channels. You can name the columns you want (for example name messages) and choose an output --format such as raw_json for parsing in scripts.
Common usage
rabbitmqadmin list queues name messages
rabbitmqadmin list exchanges name type
rabbitmqadmin list bindings source destination routing_key
# machine-readable for assertions
rabbitmqadmin --format=raw_json list queues name messagesOptions
| Arg | What it does |
|---|---|
| list queues [cols...] | List queues, optionally selecting columns |
| list exchanges [cols...] | List exchanges |
| list bindings [cols...] | List bindings between exchanges and queues |
| --format=raw_json | Emit JSON instead of a table |
| --vhost=<vhost> | Restrict to a virtual host |
| -u <user> / -p <pass> | Management credentials |
In CI
Use --format=raw_json and parse with jq to assert on message counts deterministically, for example that queue orders has messages == 1 after a publish. The plain table format is fine for logs but awkward to assert on.
Common errors in CI
"Access refused for user 'guest'" is the usual credential or guest-localhost restriction. An empty list where you expected queues usually means you are querying the wrong --vhost. A connection error on 15672 means the management plugin is disabled or the port is not exposed; enable rabbitmq_management and expose 15672.