Messages stuck in a RabbitMQ queue? 7 causes and how to fix them

•8 min read•RabbitMQ tutorial

Messages stuck in a RabbitMQ queue? 7 causes and how to fix them

Your queue keeps growing, or messages sit there and nothing happens. Before restarting anything, find out which of these seven problems you have: each one has a different fix, and restarting the wrong thing can make it worse. Every section below gives you the command to confirm the cause and the fix.

Step 0: look at the right numbers

Start by listing the queues with the four columns that tell the story:

rabbitmqctl list_queues -p / name messages_ready messages_unacknowledged consumers

Or with the HTTP API of the management plugin:

curl -s -u guest:guest "http://localhost:15672/api/queues?columns=name,messages_ready,messages_unacknowledged,consumers"
  • messages_ready are messages waiting to be delivered.
  • messages_unacknowledged are messages delivered to a consumer but not acknowledged yet.
  • consumers is the number of consumers attached to the queue.

The combination of these three numbers points to the cause:

ReadyUnackedConsumersMost likely cause
High00No consumer
Low or 0High> 0Consumers that never ack
High= prefetch × consumers> 0Consumers stuck on a few messages or slow consumers
StableStable> 0A poison message being redelivered
Growing everywhereA resource alarm or a slow consumer
00> 0, but your app sees nothingMessages routed somewhere else

1. No consumer is attached

The most common cause, and the easiest to miss: consumers is 0. The consumer process crashed, was scaled to zero, lost its connection and did not reconnect, or consumes from a queue with a slightly different name (order vs orders, a different virtual host).

Confirm it:

rabbitmqctl list_consumers -p /

If your queue is not in the list, nobody consumes it.

Fix it: restart or scale up the consumer, and check its logs for connection errors. Make sure your client library reconnects automatically after a network failure or a broker restart: many outages are consumers that died silently during a cluster maintenance and never came back. Double-check the queue name and the virtual host in the consumer configuration.

2. Consumers receive messages but never acknowledge them

messages_unacknowledged is high and does not go down, messages_ready is low. Messages were delivered, but the consumer never sent the ack. RabbitMQ keeps them reserved for that consumer until it acks them, or until its channel closes.

Typical causes:

  • the code forgets to call ack in one branch, often in an error path,
  • the consumer uses manual acknowledgment but the library is configured for auto-ack elsewhere, or the opposite,
  • the processing hangs on a call without timeout (HTTP, database lock),
  • the ack is sent on a different channel than the one that received the message, which RabbitMQ rejects by closing the channel.

Confirm it: look at the consumers of the queue and their channels in the management UI, or:

rabbitmqctl list_channels name consumer_count messages_unacknowledged prefetch_count

A channel with a high messages_unacknowledged and no progress is your stuck consumer.

Fix it: fix the code path that does not ack, add timeouts to external calls, and make sure every message ends with an ack, a nack or a reject. Restarting the consumer releases the messages (they go back to ready, marked as redelivered), but they will get stuck again if the bug is still there. Since RabbitMQ 3.8.15, a consumer timeout (30 minutes by default) closes channels that hold an unacked message for too long, which is a good safety net. Our guide on message acknowledgment covers the details.

3. A low prefetch and a stuck consumer

The prefetch (basic.qos) limits how many unacked messages a consumer can hold. With a prefetch of 1 and one consumer stuck on a slow message, the queue does not move at all, even if the consumer is "connected".

The opposite problem exists too: with no prefetch limit, one consumer can grab thousands of messages, keep them in memory, and leave nothing for the others. You see a huge unacked count on a single channel while other consumers are idle.

Fix it: set an explicit prefetch. A value between 10 and 100 is a good starting point for most workloads: high enough to keep consumers busy, low enough to spread messages across consumers. Combine it with timeouts so one slow message cannot block a consumer forever.

4. Consumers are simply too slow

Everything works, messages are acked, but publishers produce faster than consumers process. The queue grows slowly and steadily, and the instantaneous rates in the management UI hide it because they fluctuate.

Confirm it: compare the publish rate and the ack rate over several minutes, not a single snapshot. A better signal is the queue depth over time: if the trend is positive, the queue will never drain at the current capacity. We explain how to compute that trend in how to predict when a RabbitMQ queue will be empty.

Fix it: add consumers (and make sure the work can be parallelized), raise the prefetch if consumers spend their time waiting for messages, or optimize the processing. If the backlog is temporary, for example after an outage, estimate the drain time before deciding to scale: sometimes the queue will be empty in 10 minutes and nothing needs to be done.

5. A poison message is redelivered forever

A message makes the consumer crash, or the consumer rejects it with requeue=true. RabbitMQ puts it back at the head of the queue and delivers it again, immediately. The queue looks busy (high redeliver rate) but its depth does not change, and the messages behind the poison one may be delayed.

Confirm it: a high redeliver rate on the queue, and the same message ID in your consumer logs again and again.

Fix it: never requeue a message forever. Reject it with requeue=false after a few attempts, and configure a dead-letter exchange so rejected messages go to a dead-letter queue instead of disappearing. On quorum queues, set a delivery-limit so RabbitMQ dead-letters the message automatically after N deliveries. For retries with delay, see the retry pattern and exponential backoff.

Once the poison messages are in a dead-letter queue, you still need to look at them, understand why they failed and replay the ones that can be replayed. That is what dead-letter queue introspection is about.

6. A memory or disk alarm is blocking publishers

When a node uses more memory than its high watermark, or its free disk space goes under the limit, RabbitMQ raises an alarm and blocks every connection that publishes, across the whole cluster. Publishers hang, and depending on their timeouts, messages pile up in your applications rather than in RabbitMQ.

Confirm it:

rabbitmq-diagnostics -q alarms

Or call /api/health/checks/alarms on the management API, which returns 503 when an alarm is active. Our RabbitMQ health check guide lists all the checks.

Fix it: let consumers drain the queues (memory is freed as messages are acked), free disk space, and look for the queue that grew too much in the first place. Long queues with classic queues in memory are the usual suspect. Set limits (x-max-length, a TTL, or an overflow policy) on queues that can grow without bound.

7. Messages are not routed to the queue you think

The queue is empty and has consumers, but your application says it published messages. They went somewhere else, or nowhere:

  • the routing key does not match any binding (a typo, a different separator in a topic pattern),
  • the binding exists in another virtual host,
  • the exchange is a direct exchange and the routing key must match exactly,
  • unroutable messages are silently dropped unless the publisher sets mandatory or the exchange has an alternate exchange.

Confirm it: check the bindings of the queue and the drop_unroutable / return_unroutable rates in the overview. Publish a test message and see where it lands. If you are unsure how topic patterns match, our topic exchange guide has examples.

Fix it: fix the binding or the routing key, and add an alternate exchange on important exchanges to catch unroutable messages instead of losing them.

Find the stuck queue faster

Running these commands queue by queue is fine when you already know which queue is in trouble. When you don't, you want the whole cluster checked at once.

That is what the RabbitGUI Health report does: it applies these rules to every queue, uses the queue depth trend instead of noisy rates, recognizes dead-letter queues, and ranks the findings by severity and backlog size. You can also ask an AI agent to do the investigation for you with the RabbitGUI MCP server: "why is the orders queue growing on production?"

FAQ

Why are my RabbitMQ messages unacked?

They were delivered to a consumer that has not acknowledged them yet. Either the consumer is still processing them, it is stuck, or its code never sends the ack. They stay unacked until the consumer acks them or its channel closes, at which point they go back to ready.

How do I release unacked messages in RabbitMQ?

Close the channel or the connection of the consumer that holds them, for example by restarting the consumer. The messages are requeued and marked as redelivered. Fix the cause first, otherwise they will get stuck again.

Why is my RabbitMQ queue growing even though consumers are connected?

Consumers are slower than publishers, a consumer is stuck with a low prefetch, or a poison message is redelivered in a loop. Compare the queue depth trend over several minutes and look at the unacked and redeliver counts.

How do I see which consumer is connected to a queue?

rabbitmqctl list_consumers -p <vhost> lists every consumer with its queue, channel and prefetch. The management UI shows the same information on the queue page.

Can a message stay in a RabbitMQ queue forever?

Yes. Without a message TTL, a queue TTL or a length limit, a message stays in the queue until it is consumed and acked. Set a TTL and a dead-letter exchange on queues where old messages are useless.

Know what is wrong before your users do

RabbitGUI ranks every problem on your RabbitMQ cluster by severity, and takes you to the fix in one click.

Check my cluster health

Available on Windows, Mac, and Linux.

Read more RabbitMQ tutorials

RabbitMQ queue types: classic vs quorum vs streamRabbitMQ tutorialRabbitMQ queue types: classic vs quorum vs streamWhich RabbitMQ queue type should you use? Classic, quorum and stream queues compared on replication, data safety, ordering, features and performance, for RabbitMQ 4.x.RabbitMQ health checks: CLI, HTTP API, Docker and KubernetesRabbitMQ tutorialRabbitMQ health checks: CLI, HTTP API, Docker and KubernetesCopy-paste RabbitMQ health checks. rabbitmq-diagnostics commands, /api/health endpoints, a Docker Compose healthcheck and Kubernetes probes that don't hurt your cluster.The RabbitMQ Management UI: a complete guideRabbitMQ tutorialThe RabbitMQ Management UI: a complete guideHow to enable the RabbitMQ management plugin, open the UI on port 15672 (Docker too), log in, and what each tab does, plus its limits.RabbitMQ retry queue vs dead letter queue: what's the difference?RabbitMQ tutorialRabbitMQ retry queue vs dead letter queue: what's the difference?A retry queue holds a failed RabbitMQ message before another attempt, a dead-letter queue holds it once it should no longer be processed. Learn when to use each, how to combine them, and how they differ from requeue.RabbitMQ exponential backoff: how to retry messages with increasing delaysRabbitMQ tutorialRabbitMQ exponential backoff: how to retry messages with increasing delaysHow to implement exponential backoff retries in RabbitMQ with TTL retry queues and dead-letter exchanges. Track attempts with an x-retry-count header, choose retry delays, and send final failures to a DLQ.What is AMQP? The Advanced Message Queuing Protocol explainedRabbitMQ tutorialWhat is AMQP? The Advanced Message Queuing Protocol explainedLearn what AMQP (Advanced Message Queuing Protocol) is, how it works, its core concepts, why it powers RabbitMQ, and how it compares to alternatives like MQTT, STOMP, and Kafka.