I have an application that runs as multiple instances (pods on Kubernetes).
This application consumes messages from the queue with prefetch 1 and ack back after It finishes the process.
I have a function that must run from only one instance at a time. But the queue tries to send the next message to others instance consumers.
Is there anyways to block other consumers to not receive a message or block a queue to not send a message before ack?
Thanks you very much
I've found the solution on the Rabbit MQ document now. I just need to put an argument "x-single-active-consumer" when declaring the queue.
https://www.rabbitmq.com/consumers.html#single-active-consumer