[rabbitmq-discuss] Count Constraining Q
Emile Joubert
emile at rabbitmq.com
Wed Nov 23 10:55:21 GMT 2011
Hi Marc,
On 23/11/11 00:15, Marc Dworkin wrote:
> My Question is this: I would like to be able to specify the number of
> instances of a particular job running at any given time. Currently I
If I understand your question correctly it could be rephrased as "how
can I limit the number of unacknowledged messages in a queue with
multiple consumers?"
If you had a way of limiting the number of consumers to the queue to the
desired number then that can limit the number of unacknowledged
messages. Declaring or redeclaring a queue returns the current consumer
count. This number could be used to determine whether a queue is allowed
any more consumers. Each consumer should only be allowed one
unacknowledged message.
It is possible to limit the number of unacknowledged messages held by a
single consumer, using the basic.qos method. A single specialised
consumer that used the desired QoS value, and redistributed jobs to
workers might also solve the problem.
-Emile
More information about the rabbitmq-discuss
mailing list