title: RabbitMQ Manual ACK on c# client
body: <p>I'm trying to use a manual ACK on a very simple console application, but I can't make it work.</p>
  
  <p>On the sender, I have the following code:</p>
  
  <pre><code>var factory = new ConnectionFactory() { HostName = "localhost" };
  using (var connection = factory.CreateConnection())
  using (var channel = connection.CreateModel())
  {
      channel.QueueDeclare(queue: "task_queue",
                           durable: true,
                           exclusive: false,
                           autoDelete: false,
                           arguments: null);
  
      var message = GetMessage(args);
      var body = Encoding.UTF8.GetBytes(message);
  
      channel.ConfirmSelect();
      channel.BasicAcks += (sender, e) =&gt;
      {
          Console.Write("ACK received");
      };
  
      var properties = channel.CreateBasicProperties();
  
      channel.BasicPublish(exchange: "",
                           routingKey: "task_queue",
                           basicProperties: properties,
                           body: body);
  
      Console.WriteLine(" [x] Sent {0}", message);
  }
  
  Console.WriteLine(" Press [enter] to exit.");
  Console.ReadLine();
  </code></pre>
  
  <p>On the receiver I have the following code:</p>
  
  <pre><code>var factory = new ConnectionFactory() { HostName = "localhost" };
  using (var connection = factory.CreateConnection())
  using (var channel = connection.CreateModel())
  {
      channel.QueueDeclare(queue: "task_queue",
                           durable: true,
                           exclusive: false,
                           autoDelete: false,
                           arguments: null);
  
      channel.BasicQos(prefetchSize: 0, prefetchCount: 1, global: false);
      channel.ConfirmSelect();
  
      Console.WriteLine(" [*] Waiting for messages.");
  
      var consumer = new EventingBasicConsumer(channel);
      consumer.Received += (model, ea) =&gt;
      {
          var body = ea.Body;
          var message = Encoding.UTF8.GetString(body);
          Console.WriteLine(" [x] Received {0}", message);
  
          int dots = message.Split('.').Length - 1;
          Thread.Sleep(dots * 1000);
  
          channel.BasicAck(deliveryTag: ea.DeliveryTag, multiple: false);
          Console.WriteLine(" [x] Done");
      };
      channel.BasicConsume(queue: "task_queue",
                           noAck: false,
                           consumer: consumer);
  
      Console.WriteLine(" Press [enter] to exit.");
      Console.ReadLine();
  }
  </code></pre>
  
  <p>What I expect is that the event <code>BasicAcks</code> on the sender is fired when I call <code>channel.BasicAck()</code> on the receiver, but that event is being fired when the message is delivered to the client, before <code>consumer.Received</code>.</p>
  
  <p>Is what I'm expecting the correct behavior or am I missing something?</p>