Ayush Gupta
Ayush Gupta

Reputation: 9305

RabbitMQ behavioural difference between Consumer Ack vs Consumer Nack with requeue false?

In RabbitMQ, after consumer receives and processes message, I can either ack it, or I can nack it.

Nacking the message with requeue true puts in back into the queue, however, requeue false does not.

So I was wondering what's the difference between Consumer Ack vs Consumer Nack with requeue false, or can we just ack instead of the nack?

Upvotes: 1

Views: 1215

Answers (1)

Gabriele Santomaggio
Gabriele Santomaggio

Reputation: 22750

between Consumer Ack vs Consumer Nack with requeue false

See https://www.rabbitmq.com/dlx.html

Dead Letter Exchanges
Messages from a queue can be "dead-lettered"; 
that is, republished to an exchange when any of the following events occur:

The message is negatively acknowledged by a consumer using basic.reject or basic.nack 
with requeue parameter set to false.

....

In short: basic.nack with requeue = false redirects the messages to the DLX exchange (if dlx is configured).

Upvotes: 3

Related Questions