RabbitMQ CLI Cheatsheet
Top commands.
Overview
RabbitMQ operations live in the CLI. The cheatsheet captures the patterns operators actually use during investigation; CLI fluency reduces MTTR more than any dashboard.
- Top commands.
list_queues,list_consumers,list_connections,list_exchanges; the working set. - Queue inspection. Per-queue depth and consumer count surface most consumer issues immediately.
- Connection management.
close_connectionon stuck connections; the recovery move when consumers wedge. - Cluster management.
cluster_statusandchange_cluster_node_type; HA decisions live here.
The approach
The practical approach is queue-depth monitoring plus connection cleanup plus cluster-aware operations. The CLI is the discipline; the UI is the fallback.
- List queues.
rabbitmqctl list_queues name messages consumers; per-queue state in one command. - List consumers.
rabbitmqctl list_consumers; active consumers and their queues; investigation starts here. - Force-close stuck.
rabbitmqctl close_connection; the recovery move when a connection hangs. - Cluster status.
rabbitmqctl cluster_status; HA health at a glance.
Why this compounds
RabbitMQ CLI fluency compounds across investigations. Each one grows the team's messaging expertise; the discipline matures over years, not months.
- Faster debugging. Fluent CLI produces fast root cause; MTTR drops as muscle memory builds.
- Better hygiene. Depth monitoring catches consumer issues before they become incidents.
- Better automation. CLI replaces UI clicks; the operations become scriptable, repeatable, audit-trail-friendly.
- Compounding knowledge. Each investigation teaches messaging patterns; year 2+ is habit, not learning.