title: How to return ACK from consumer as soon as message is received/consumed?
body: <p>I am using <code>nameko.messaging.consume</code> for consuming messages from a queue. Here’s a sample code -</p>
  <pre class="lang-py prettyprint-override"><code>from kombu import Queue
  from nameko.messaging import consume
  
  class Service:
      name = &quot;sample_service&quot;
      QUEUE = Queue(&quot;queue_name&quot;, no_declare=True)
  
      @consume(QUEUE)
      def process_message(self, payload):
          # Some long running code ...
          return result
  </code></pre>
  <p>By default behaviour, ACK will be sent to rabbitMQ broker after <code>process_message</code> function returns a response (Here, statement <code>return result</code>). I want to send an ACK as soon as <code>consumer consumes the message</code>. How can I do that?</p>
  <p>*In library <code>pika</code>, consumer acknowledges as soon as message is consumed. That will be good example what I want to replicate with nameko’s consumer.</p>
  <p>Thanks :)</p>