[rabbitmq-discuss] How to handle poison messages (version 3.0.1)?

Sandeep Aggarwal aggarwalsandeep at optonline.net
Thu Jan 17 22:49:37 GMT 2013


Hi All -

I'm using RabbitMQ version 3.0.1 and trying to handle the case with poison 
messages. 

In our code here, if there is a problem with processing the message, we 
nack the message with redeliver flag set to true. However, this causes the 
message to go back in the queue and in turn the consumer reads the same 
message again (and again in a loop). This causes my consumer to crash or go 
fishing in a loop.

I know there are features in some other messaging libraries (such as MSMQ) 
to handle poison messages - there does not seem to be an out of the box 
option in RabbitMQ for this feature. Could someone please suggest what 
others are doing to handle this scenario? 

I do have an option in mind - we can check for the redelivered flag to be 
true and if its true more than 3 times for a given message, we can post 
this message to a poison queue and ack it in the main queue. It's do-able 
but I'm hoping there is some option directly from rabbitMQ. Thanks in 
advance. 

Thanks,
Sandy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130117/92090159/attachment.htm>


More information about the rabbitmq-discuss mailing list