<p>I have an application that runs as multiple instances (pods on Kubernetes).</p>
<p>This application consumes messages from the queue with prefetch 1 and ack back after It finishes the process.</p>
<p>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.</p>
<p>Is there anyways to block other consumers to not receive a message or block a queue to not send a message before ack?</p>
<p>Thanks you very much</p>

LLF
<p>I've found the solution on the Rabbit MQ document now.
I just need to put an argument &quot;x-single-active-consumer&quot; when declaring the queue.</p>
<p><a href="https://www.rabbitmq.com/consumers.html#single-active-consumer" rel="nofollow noreferrer">https://www.rabbitmq.com/consumers.html#single-active-consumer</a></p>
