Open anderslemke opened 5 years ago
This does not make the consumer exclusive, it makes the queue exclusive. Is that what you are really after?
@michaelklishin I might confuse some concepts here.
There is an exclusive
flag in this gem already:
https://github.com/jondot/sneakers/blob/7c059d1490e4dde43f98b801c38e4e0df7ac458c/lib/sneakers/configuration.rb#L20
As far as I understand, this controls the queue: https://www.rabbitmq.com/queues.html#exclusive-queues . This is what I would call "exclusive queue".
I want this PR to control the exclusive
-flag in https://www.rabbitmq.com/amqp-0-9-1-reference.html#basic.consume . This is what I refer to when I say "exclusive consumer".
I will beef up the PR-description to talk about the motivation for this.
@michaelklishin I've tested this PR locally, and I get the following results.
When I set the new exclusive
-flag to false
, I get consumers with this config:
When I set the new exclusive
-flag to true
, I get a consumer with this config:
This is actually what I want to achieve. But I'm not sure I use the terms correct, though.
In some situations, the execution order of messages is crucial. In such situations, RabbitMQ can ensure that there are no more than one consumers on a queue, with the exclusive option.