title: RabbitMQ with manual ack throwing "Shared Queue Closed"
body: <p>The consumer code below (not too far removed from the worker sample) throws  System.IO.EndOfStreamException ("SharedQueue closed") after a couple of iterations of a single message being nacked. </p>
  
  <pre><code>public void Consume ()
              {
                  using (var connection = connectionFactory.CreateConnection ()) {
                      using (var channel = connection.CreateModel ()) {
  
                          channel.QueueDeclare (queueName, true, false, false, null);
  
                          // 0= “Dont send me a new message untill I’ve finshed”,  
                          // 1= “Send me one message at a time”
                          channel.BasicQos (0, 1, false);
                          var consumer = new QueueingBasicConsumer (channel);
                          channel.BasicConsume (queueName, false, consumer);
  
                          Console.WriteLine (" [*] Waiting for messages. " +
                          "To exit press CTRL+C");
  
                          while (true) {
                              BasicDeliverEventArgs ea;
                              try {
                                  // block until a message can be dequeue
                                  ea = (BasicDeliverEventArgs)consumer.Queue.Dequeue ();
  
                                  var body = ea.Body;
                                  Console.WriteLine (" [x] Received, executing");
  
                                  T thing = messageSerializer.Deserialize&lt;T&gt; (body);
  
                                  try {
                                      executor.DynamicInvoke (thing);
                                  } catch {
                                          channel.BasicNack (ea.DeliveryTag, false, true);
                                      }
                                  }
  
                                  channel.BasicAck (ea.DeliveryTag, false);
                              } catch (OperationCanceledException) {
                                  logger.Error ("Bugger");
                              }
                          }
                      }
                  }
  </code></pre>
  
  <p>I've read a few google results but AKAIK this typically happens when the stream has been closed due to manually acking when auto ack is set?</p>
  
  <p>Thanks in advance.</p>