Reputation: 544
So the scenario is 1 publisher and 2 consumers. The queue requires acks from consumers in order for the message to be removed from the queue.
1st consumer receives message from queue but doesn't ack so the message stays on the queue.
When the 2nd consumer reads from the queue, will the 2nd consumer receive the message? or does the publisher have to wait for a Nack from 1st consumer, in order to be able to pass on that message to 2nd consumer?
Upvotes: 0
Views: 92
Reputation: 1479
Until an acknowledgement is received (ack or nack) the message will remain on the queue but not be delivered to another competing consumer.
Only when a nack with requeue=true is sent will another consumer get it. And there is no guarantee that it will be consumer 2. If consumer 1 is still going then perhaps it will get delivered back to consumer 1. It depends if there have been other messages that have been processed in that time period.
Upvotes: 1