I'm using Pika library in Python.
In my consumer, I set the prefetch count using:
ch.basic_qos(prefetch_count=6)
When I receive 6 messages, I process it and if that fails for whatever reason (DB cursor gets disconnected for example), I want to send a negative ack for multiple messages and requeue those, which I do using:
ch.basic_nack(delivery_tag=method.delivery_tag, multiple=True,requeue=True)
But these messages are still "unacked", and my consumer does not get any more messages.
Going through the docs, I understand that basic_qos allows RabbitMQ to send X number of messages before waiting for an ack, but I assumed a nack would also work and I will continue to receive more messages or even get into a receive/nack loop.
But the consumer just gets stuck after sending the nack.
Am I missing something here? If nack is not supposed to work with prefetch, is there another way to use prefetch and still nack messges?