[rabbitmq-discuss] Consume

Yann Luppo yluppo at leads360.com
Thu Oct 13 20:00:18 BST 2011


Hi,

 

I'm currently trying to setup RabbitMQ for my company and we have 1
publisher pushing to 1 queue, pretty simple so far. 

But we have lots of consumers, potentially up to a hundred, reading that
queue. Reason being the processing of each of those messages can take a
long time.

 

To clarify, in our current scenario after processing, the consumer logic
requeues the message. The goal is to have a given set of messages being
processed over and over again in a cycle.

 

We're using the .Net client library and we quickly favored the consumer
approach:

 

QueueingBasicConsumer consumer = new
QueueingBasicConsumer(this.channel);

string consumerTag = this.channel.BasicConsume(this.queueName, noAck,
consumer);

 

But we ran into issues where the messages were getting dropped. I payed
attention to make sure we were doing the necessary ACK and/or NACK to
make sure a message always gets processed.

After a while I decided that my implementation was flawed somewhere, so
for a test I simplified the code and started using the Subscription
object:

 

Subscription subscription = new Subscription(this.channel,
this.queueName, false);

 

foreach (BasicDeliverEventArgs e in subscription)
{
  if (!e.Redelivered)
    ...
}
 
 

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 a
round-robin-like distribution?

 

Thanks,

Yann

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20111013/66544771/attachment.htm>


More information about the rabbitmq-discuss mailing list