Re: [rabbitmq-users] Using basic.nack with basic.qos

9 views
Skip to first unread message

Michael Klishin

unread,
Feb 28, 2020, 6:58:55 PM2/28/20
to rabbitmq-users
Acks and nacks are identical in RabbitMQ as far as prefetch effects go. My guess is that you are double acking [1] and that closes the channel.


On Wed, Feb 12, 2020 at 10:18 AM Jay <jay...@finn.ai> wrote:
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?


This message is confidential. It may also be privileged or otherwise protected by work product immunity or other legal rules. If you have received it by mistake, please let us know by e-mail reply and delete it from your system; you may not copy this message or disclose its contents to anyone. Please send us by fax any message containing deadlines as incoming e-mails are not screened for response deadlines. The integrity and security of this message cannot be guaranteed on the Internet.

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/82443bdc-fa14-4f43-82a7-2f5f8c3fc1ff%40googlegroups.com.


--
MK

Staff Software Engineer, Pivotal/RabbitMQ
Reply all
Reply to author
Forward
0 new messages