[rabbitmq-discuss] Dead letter exchange behavior / best practice

Ludovic Fleury ludo.fleury at gmail.com
Sun Oct 28 06:41:54 GMT 2012


Hey,

I'm new to RabbitMQ and I try to use the dead letter exchange feature.
Yet, I don't know if I make a misstake or if I misunderstand the 
documentation about it:

As far as I read in the doc: 

The dead-lettering process adds an array to the header of each 
> dead-lettered message named x-death. 

This array contains an entry for each time the message was dead-lettered. 
> Each such entry is a table that consists of several fields


So basically, I have 2 queues and 2 exchanges:
-"my-exchange" bound to "my-queue"
-"my-dead-exchange" bound to "my-dead-queue"

I have set a DLX on "my-queue" to "my-dead-exchange" and I have set another 
DLX on "my-dead-queue" to ... "my-dead-exchange".
The last DLX is a cylic DLX. I hope this is okay ?

When I first reject a message on "my queue", everything is okay: I have the 
message handled by "my-dead-exchange" and placed to "my-dead-queue".
But then, when I reject again the message... The message is not handled by 
"my-dead-exchange" and nor replaced into the "my-dead-queue".

With the documentation, I understand that: every time a message is 
rejecteted, I would be able to "count" the number of rejection by counting 
on the "x-death" header.
So instead of rejecting with a requeue, I would like to take advantage of 
this behavior by rejecting into a "cylic DLX" (to count the total of 
rejection for a message).

Is my implementation incorrect ? How can I handle this need in RabbitMQ ?
Thanks.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20121027/5b6eeccc/attachment.htm>


More information about the rabbitmq-discuss mailing list