Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

rabbitmq

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)?

like image 521
Anil Kumar Avatar asked Aug 10 '15 09:08

Anil Kumar


People also ask

What are ready messages in RabbitMQ?

A message is ready when it is waiting to be processed. Whenever a consumer connects to the queue it receives a batch of messages to process. Meanwhile, the consumer is working on the messages the amount is given in prefetch size and they get the message unacked.

How do you Requeue Unacked messages in RabbitMQ?

To reject messages in bulk, clients set the multiple flag of the basic. nack method to true . The broker will then reject all unacknowledged, delivered messages up to and including the message specified in the delivery_tag field of the basic. nack method.

Does RabbitMQ is push or pull?

RabbitMQ uses a push model and prevents overwhelming consumers via the consumer configured prefetch limit. This is great for low latency messaging and works well for RabbitMQ's queue based architecture. Kafka on the other hand uses a pull model where consumers request batches of messages from a given offset.

Does RabbitMQ delete message after consumed?

you are telling RabbitMQ to automatically acknowledge the message when it is consumed. acknowledging a message tells RabbitMQ that it has been taken care of and RabbitMQ can delete it now. set autoAck to false if you want to manually acknowledge the message after you are done processing it.


2 Answers

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.

like image 89
l.renkema Avatar answered Sep 28 '22 16:09

l.renkema


enter image description here

Un-acknowledgment: It is used for Data Safety Considerations. it guaranteed to reach the peer and successfully processed. In case consumer lost in-between of processing of message and not acknowledge the Rabbit MQ. message will not lost and available for cosumer to process it again.

like image 22
Rakesh Soni Avatar answered Sep 28 '22 16:09

Rakesh Soni