yluppo at leads360.com
Fri Oct 14 17:40:28 BST 2011
Perfect! Merci Emile! :)
From: Emile Joubert [mailto:emile at rabbitmq.com]
Sent: Friday, October 14, 2011 2:33 AM
To: Yann Luppo
Cc: rabbitmq-discuss at lists.rabbitmq.com
Subject: Re: [rabbitmq-discuss] Consume
On 13/10/11 20:00, Yann Luppo wrote:
> To clarify, in our current scenario after processing, the consumer
> requeues the message. The goal is to have a given set of messages
> processed over and over again in a cycle.
That sounds unusual. What is the criteria for stopping processing? A
different pattern for multiple rounds of processing is to have a queue
for each round of processing and for consumers to republish the message
to the next queue in a chain.
You should also avoid relying on the current (v 2.6.1) requeue behaviour
of rabbit which requeues messages at the back of the queue. To guarantee
that messages return to the back of the queue you should acknowledge and
republish instead of requeue.
> After a while I decided that my implementation was flawed somewhere,
> for a test I simplified the code and started using the Subscription
> The problem w/ this approach is all our consumers read all the
> messages.... Instead of just dequeuing in a round-robin fashion.
> Could someone point me in the right direction for using RabbitMQ to do
> round-robin-like distribution?
If you have multiple subscriptions to the same queue then consider
setting qos on the channel before creating the Subscription (see
IModel.BasicQos). Internally Subscription uses a QueueingBasicConsumer
which will receive all the messages in the queue unless qos is set.
More information about the rabbitmq-discuss