[rabbitmq-discuss] messages one at a time
Emile Joubert
emile at rabbitmq.com
Mon Apr 2 12:42:00 BST 2012
Hi Raoul,
On 02/04/12 11:34, Raoul Buzziol wrote:
> 2012/4/2 Emile Joubert <emile at rabbitmq.com <mailto:emile at rabbitmq.com>>
> Hi Raoul,
>
> On 02/04/12 09:37, Raoul Buzziol wrote:
> > I'm looking for a way to consume messages from a queue by multiple
> > consumer one at a time. The queue should deliver a new message only
> > after an ack.
>
> I'd be interested to understand your motivation for wanting multiple
> consumers consuming from a queue, but only allow one consumer to hold an
> unacknowledged message at a time. You will get equivalent performance to
> having only one consumer.
>
>
> You're right, I will get equivalent performance.
> My requirement is that a kind of message cannot be precessed in
> parallel. With multiple consumer I can have a sort of failover, when one
> consumer goes away (or down) an other is already there.
You could publish messages with the immediate flag turned on. That will
alert the publisher if a destination queue lacks consumers and you can
use that information to start a new consumer. This is a possibly better
alternative to constantly polling queues to ensure that they all have
consumers.
-Emile
More information about the rabbitmq-discuss
mailing list