RabbitMQ" What are "Ready" and "Unacked" types of messages?

Anil Kumar picture Anil Kumar · Aug 10, 2015 · Viewed 49.9k times · Source

I'm getting confused between these two types of messages in RabbitMQ.

I've seen that some of my queues have 0 "Unacked" and 1000 "Ready" messages, while some have 1000 "Unacked" and 0 "Ready" messages.

What's the difference between them?

And how can I know how many of the messages are read by the consumer(s)?

Answer

l.renkema picture l.renkema · Aug 10, 2015

A message is Ready when it is waiting to be processed.

When a consumer connects to the queue it gets a batch of messages to process. The amount is given in the prefetch size. While this consumer is working on the messages they get the status unacked.

Unacked means that the consumer has promised to process them but has not acknowledged that they are processed. When the consumer crashed the queue knows which messages are to be delivered again when the consumer comes online. When you have multiple consumers the messages are distributed among them.