[rabbitmq-discuss] Rejecting and requeuing a message to postpone it

Emile Joubert emile at rabbitmq.com
Thu Sep 20 11:12:35 BST 2012


On 20/09/12 00:36, fourat wrote:
> How would you resolve such an issue ?

You can simulate delayed publishing by publishing to a queue with the
required per-message TTL as well as a dead-letter-exchange (DLX)
configured. When the TTL expires it will be published to the DLX, so the
nett  effect is delayed publishing.

You might also consider delaying the requeue operation on the client
until the prerequisite service is available.

You could also craft a solution by taking the "redelivered" parameter
into account. This boolean flag indicates whether a message has been
previously delivered. Attempting to requeue a message that has already
been redelivered might signal the onset of a loop and this might be a
good place to introduce a delay or additional logic to prevent the loop.


More information about the rabbitmq-discuss mailing list