title: How to set timeout detection on a RabbitMQ server?
body: <p>I am trying out <a href="http://www.rabbitmq.com/" rel="noreferrer">RabbitMQ</a> with <a href="http://barryp.org/software/py-amqplib/" rel="noreferrer">this</a> python binding.</p>
  
  <p>One thing I noticed is that if I kill a consumer uncleanly (emulating a crashed program), the server will think that this consumer is still there for a long time. The result of this is that every other message will be ignored.</p>
  
  <p>For example if you kill a consumer 1 time and reconnect, then 1/2 messages will be ignored. If you kill another consumer, then 2/3 messages will be ignored. If you kill a 3rd, then 3/4 messages will be ignored and so on.</p>
  
  <p>I've tried turning on acknowledgments, but it doesn't seem to be helping. The only solution I have found is to manually stop the server and reset it. </p>
  
  <p>Is there a better way?</p>
  
  <p><strong>How to recreate this scenario</strong></p>
  
  <ul>
  <li><p>Run rabbitmq.</p></li>
  <li><p>Unarchive <a href="http://barryp.org/static/software/download/py-amqplib/0.6/amqplib-0.6.tgz" rel="noreferrer">this library</a>.</p></li>
  <li><p>Download the consumer and publisher <a href="http://blogs.digitar.com/jjww/code-samples/" rel="noreferrer">here</a>.
  Run amqp_consumer.py twice. Run amqp_publisher.py, feeding in some data and observe that it works as expected. Messages are received round robin style.</p></li>
  <li><p>Kill one of the consumer processes with kill -9 or task manager.</p></li>
  <li><p>Now when you publish a message, 50% of the messages will be lost.</p></li>
  </ul>