title: RabbitMQ - surviving a consumer disconnection using DefaultConsumer
body: <p>using java client QueueingConsumer I wrote the following code to assist consumer recovery</p>
  
  <pre><code>while (true) {
     try{
        .. create connection
        .. create channel &amp; queue
        while (true) {
               final QueueingConsumer.Delivery delivery = consumer.nextDelivery();
               ....
        } catch {
            handleException()
        }
  }
  </code></pre>
  
  <p>And every time I restarted rabbit it survived cause it created the connection from start.<br>
  Now, I understand I should be working with DefaultConsumer.<br>
  So I have this method   </p>
  
  <pre><code>public void handleDelivery(...) throws IOException {
  }
  </code></pre>
  
  <p>and my problems are :  </p>
  
  <ol>
  <li>I cant catch the exception inside and recreate the connection</li>
  <li>This only recovers when the ack fails. What if it fails in another stage of the process?
  How should I recover these fails?<br>
  Thanks. </li>
  </ol>