[rabbitmq-discuss] How to achieve HA consumers?
Laing, Michael P.
Michael.Laing at nytimes.com
Fri Aug 24 18:54:15 BST 2012
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.
From: johnson <johnson at edocom.cn<mailto:johnson at edocom.cn>>
Reply-To: johnson <johnson at edocom.cn<mailto:johnson at edocom.cn>>, rabbitmq <rabbitmq-discuss at lists.rabbitmq.com<mailto:rabbitmq-discuss at lists.rabbitmq.com>>
Date: Fri, 24 Aug 2012 12:30:01 -0400
To: rabbitmq <rabbitmq-discuss at lists.rabbitmq.com<mailto:rabbitmq-discuss at lists.rabbitmq.com>>
Subject: [rabbitmq-discuss] How to achieve HA consumers?
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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rabbitmq-discuss