I want process messages in few threads but i\'m getting error during execute this code:
from __future__ import with_statement
import pika
import sys
from pika.ad
For me, it was just that I told the queue I wasn't going to ack, then I acked.
E.g. WRONG:
channel.basic_consume(callback, queue=queue_name, no_ack=True)
and then in my callback:
def callback(ch, method, properties, body):
# do stuff
ch.basic_ack(delivery_tag = method.delivery_tag)
RIGHT:
channel.basic_consume(callback, queue=queue_name, no_ack=False)
Bottom line: If you want to manually ack, set no_ack=False.
From the docs:
no_ack: (bool) if set to True, automatic acknowledgement mode will be used (see http://www.rabbitmq.com/confirms.html)