Hi, Sandeep:<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I&#39;m using RabbitMQ version 3.0.1 and trying to handle the case with poison messages. <br>
</blockquote><div><br></div><div>I assume that by a &quot;poison message&quot; you mean a message that a consumer can definitively determine is somehow bad and should never be considered for processing again?</div><div>�</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">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.<br>
</blockquote><div><br></div><div>If we&#39;re using the same definition of poison message you could basic.reject the message, specifying requeue=false. �This will cause Rabbit to dispose of the message and not bother you with it again.</div>
<div>�</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">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&#39;s do-able but I&#39;m hoping there is some option directly from rabbitMQ. Thanks in advance. <br>
</blockquote><div><br></div><div>Such a compromise solution seems only to make sense if the message itself wasn&#39;t truly poisonous, but rather the consumer that dequeued it just wasn&#39;t able to deal with it properly upon taking possession of it. �Of course counting the number of times a given message has arrived with the redelivered flag set to true would require you to coordinate this count globally across all of your consumers if there were more than one and this might be a hassle.</div>
<div><br></div></div>