Delaying message with Dead-Letter Exchange in RabbitMQ

You have a message that you tried processing, but say your dependencies aren’t available, and you would like to retry at a later time. So you N-ACK the message with requeue. A N-ACK by default requeue the message to the FRONT of the queue. So it would result in an immediate retry, which is not helpful. RabbitMQ does not provide out-of-the-box delaying mechanism.

To make the delay happen, you can make use of the dead-letter exchange. See the hack in following post:

http://blog.james-carr.org/2012/03/30/rabbitmq-sending-a-message-to-be-consumed-later/

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s