[rabbitmq-discuss] RabbitMQ application failover/recovery in HA cluster

Emile Joubert emile at rabbitmq.com
Thu Aug 16 12:05:27 BST 2012


Hi Edward,

On 15/08/12 14:44, Wax, Edward wrote:
> our client connections in this HA environment (e.g. if I receive a
> ModelShutdown event, what steps do I need to go through in order to
> "transfer" a RabbitMQ session to a new connection).  Or are there other
> "management" APIs that should be used instead?

A possible reason for receiving a ModelShutdown event is if the broker
raises a channel exception, but this event is also sent if the
channel/Model closes normally. You won't need to re-establish a
channel/Model alone without also needing to re-establish the containing
connection due to a node failure.

The more relevant events in a clustered environment are
IConnection.ConnectionShutdown and IBasicConsumer.HandleBasicCancel.
Upon receipt of the former reconnection to another node in the cluster
could be attempted. If a subscriber of a mirrored queue receives a
cancel notification then it could attempt resubscribing, and it should
be aware that redeliveries are especially likely.

> I’ve also been looking the book, /RabbitMQ In Action/, and a section on
> application failure and recovery (6.2) sounds almost as simple as
> wrapping the consumer/producer code in a try/catch block.

That deals with recovery when connected to a cluster, rather than an HA
cluster with mirrored queues. The assumption there is that queues could
be lost, while in your case mirrored queues will not be lost as long as
any nodes that mirror it remain running.


-Emile






More information about the rabbitmq-discuss mailing list