Oleg
Oleg

Reputation: 161

How to add message back to Rabbit MQ?

The subscriber (handler scripts) receives messages from Rabbit MQ queue.

Then it checks message, do some operations. How to add handled message to back to queue if condition is not right? Is it possible in Rabbit MQ?

Upvotes: 2

Views: 832

Answers (1)

cantSleepNow
cantSleepNow

Reputation: 10170

Set autoAcknowledge to false and once you're "done with the message"- just reject it, that is send negative acknowledgement. Once it sees that the message has been nACKed, rabbitmq will re-queue it.

Upvotes: 2

Related Questions