[rabbitmq-discuss] parallel consuming from one queue

Jan Andersson Jan.Andersson at UNIBET.com
Thu Mar 24 16:38:02 GMT 2011


we are trying to setup something that we hoped would be pretty straight 
forward but can't seem to get it to work.
We want to consume messages from a persistent queue and use ack:s. 
However all of our attempts end in us consuming one message off the 
queue and then no one else (thread or process) can consume messages off 
the queue until that message has been ack:ed.

This is in Java, we set up one channel per thread like this:
channel = connection.createChannel();
channel.exchangeDeclare(configuration.getExchangeName(), "topic", true);
channel.queueDeclare(queueName, true); // durable queue
channel.queueBind(queueName, configuration.getExchangeName(), routingKey);
consumer = new QueueingConsumer(channel);
channel.basicConsume(queueName, false, consumer);

The ack is done like this:
channel.basicAck(delivery.getEnvelope().getDeliveryTag(), false);

Might be hard to answer this but if anyone could point us in the right 
direction that would be great!


The information in this email is confidential and may be legally privileged.
If you are not the intended recipient, you must not read, use or disseminate that information
and upon reception, permanently delete the original and destroy any copies.
Although this email and any attachments are believed to be free of any virus
or any other defect which might affect any computer or IT system into which
they are received and opened, it is the responsibility of the recipient to
ensure that they are virus free and no responsibility is accepted by Unibet
for any loss or damage arising in any way from receipt or use thereof.

More information about the rabbitmq-discuss mailing list