<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I'm trying to understand the CORRECT way of handling messages that cannot be processed, for some reason. <div><br></div><div>I have two consumers listening for messages (in a worker queue setup, as described here: <a href="http://www.rabbitmq.com/tutorials/tutorial-two-python.html">http://www.rabbitmq.com/tutorials/tutorial-two-python.html</a>).</div><div><br></div><div>Scenario A:<div>A message is received and processed, then it's ack'd using basic_ack.</div></div><div><br></div><div>Scenario B:<div>A message is received and processed, but an error occurs. An error like my consumer loses connection to the DB. In this case, I don't issue a basic_ack (and my consumer remains running).</div></div><div><br></div><div>In looking at the docs, I understand if a message is not acknowledged and the consumer dies, rabbit will requeue the message for redelivery. But what if the consumer remains running (and I just can't process the message). Should I not issue the basic_ack (will it get sent to another consumer)? Or should I issue the basic_ack and then reject the message?</div><div><br></div><div>I'm asking because earlier today I noticed I had an "unacknowledged" message on my queue. With the unacknowledged message on the queue, only one worker consumer was receiving all messages. </div><div><br></div><div><div><font class="Apple-style-span" face="Monaco">[root@web2 tmp]# rabbitmqctl list_queues -p / messages messages_unacknowledged messages_ready</font></div><div><font class="Apple-style-span" face="Monaco">Listing queues ...</font></div><div><font class="Apple-style-span" face="Monaco">1</font><span class="Apple-tab-span" style="white-space: pre; "><font class="Apple-style-span" face="Monaco">        </font></span><font class="Apple-style-span" face="Monaco">1</font><span class="Apple-tab-span" style="white-space: pre; "><font class="Apple-style-span" face="Monaco">        </font></span><font class="Apple-style-span" face="Monaco">0</font></div><div><font class="Apple-style-span" face="Monaco">0</font><span class="Apple-tab-span" style="white-space: pre; "><font class="Apple-style-span" face="Monaco">        </font></span><font class="Apple-style-span" face="Monaco">0</font><span class="Apple-tab-span" style="white-space: pre; "><font class="Apple-style-span" face="Monaco">        </font></span><font class="Apple-style-span" face="Monaco">0</font></div><div><font class="Apple-style-span" face="Monaco">0</font><span class="Apple-tab-span" style="white-space: pre; "><font class="Apple-style-span" face="Monaco">        </font></span><font class="Apple-style-span" face="Monaco">0</font><span class="Apple-tab-span" style="white-space: pre; "><font class="Apple-style-span" face="Monaco">        </font></span><font class="Apple-style-span" face="Monaco">0</font></div><div><font class="Apple-style-span" face="Monaco">0</font><span class="Apple-tab-span" style="white-space: pre; "><font class="Apple-style-span" face="Monaco">        </font></span><font class="Apple-style-span" face="Monaco">0</font><span class="Apple-tab-span" style="white-space: pre; "><font class="Apple-style-span" face="Monaco">        </font></span><font class="Apple-style-span" face="Monaco">0</font></div></div><div><font class="Apple-style-span" face="Monaco"><br></font></div><div><font class="Apple-style-span" face="Monaco"><span class="Apple-style-span" style="font-family: Arial; ">The other worker was in a 'stale' state and not receiving any messages. I'm just trying to understand if my logic on not ack'ing a message is correct and if that's how i ended up with an unacknowledged message. Also trying to understand why my worker just stopped receiving messages.</span></font></div><div><font class="Apple-style-span" face="Monaco"><span class="Apple-style-span" style="font-family: Arial; "><br></span></font></div><div><font class="Apple-style-span" face="Monaco"><span class="Apple-style-span" style="font-family: Arial; ">Any guidance would be appreciated!</span></font></div><div><font class="Apple-style-span" face="Monaco"><span class="Apple-style-span" style="font-family: Arial; "><br></span></font></div><div><font class="Apple-style-span" face="Monaco"><span class="Apple-style-span" style="font-family: Arial; ">Thanks</span></font></div></body></html>