[rabbitmq-discuss] How to achieve HA consumers?

johnson johnson at edocom.cn
Sat Aug 25 02:37:19 BST 2012


Thanks, Michael. Actually round-robins dispatching doesn't fit my situation well. If two consumers exist, they will get the message almost in the same time. In this way, the order of the messages cannot be assured. I wonder if there is some way that the server will send the message the second consumer only after it receives the ACK from the first consumer.




johnson

From: Laing, Michael P.
Date: 2012-08-25 03:12
To: rabbitmq; johnson
Subject: Re: [rabbitmq-discuss] How to achieve HA consumers?
Actually, rereading, perhaps my solution is different from yours…


From: Michael Laing <Michael.Laing at nytimes.com>
Reply-To: rabbitmq <rabbitmq-discuss at lists.rabbitmq.com>
Date: Fri, 24 Aug 2012 13:54:15 -0400
To: johnson <johnson at edocom.cn>, rabbitmq <rabbitmq-discuss at lists.rabbitmq.com>
Subject: Re: [rabbitmq-discuss] How to achieve HA consumers?



I use your option 1: below, which works well.


All critical services drive from HA queues and have at least one worker (consumer) connected to each node in the cluster. RabbitMQ round-robins messages to the workers. If a worker or node fails, its message is routed to another worker.


Michael
From: johnson <johnson at edocom.cn>
Reply-To: johnson <johnson at edocom.cn>, rabbitmq <rabbitmq-discuss at lists.rabbitmq.com>
Date: Fri, 24 Aug 2012 12:30:01 -0400
To: rabbitmq <rabbitmq-discuss at lists.rabbitmq.com>
Subject: [rabbitmq-discuss] How to achieve HA consumers?



Hi,

One problem I encountered is how to achieve HA consumers. My situation is the following.

I installed 1 consumer in a server to consume the messages. But in the production environment, to avoid the unexceptional crash of the consumer, I need to install another consumer in another server. However, because the order of the messages are very important, if two consumers receive the messages simultaneously, the order cannot be reserved.

Maybe the following 2 way can work.
1: At the same time, the server only sends the message to 1 consumer. After that consumer return a ACK, the server send the message to another consumer. This means that although two consumers exist, they receive the messages in turn not concurrently. Once 1 consumer crashes, the remaining consumer can still work.

2: 2 consumers work like master-slave. Only 1 consumer works and the other one doesn't consume any message. Once 1 consumer crashes, the remaining consumer will be activated.

I have searched a lot of RabbitMQ docs and couldn't find useful info. Could anyone can give me some clue? Thanks a lot.




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


More information about the rabbitmq-discuss mailing list