3

I am wanting to setup RabbitMQ as a two (or more) node cluster with HA.

Use case: a client producer app (C#.NET) knows that the cluster has two nodes and publishes to the cluster. Various consumer apps (also C#.NET) connect to the cluster and get all messages generated by the producer. So long as at least one node is up and running the producer and consumers will all continue to work without error. Supposing nodes A and B are running and B dies for a while, then gets restarted, then a while later A dies, the clients all continue to function without receiving an error since at all times at least one node is up.

Can it be made to work like this out of the box?

Are there any other MQs that would be more appropriate (commercial ok) for a Windows/.NET application environment?

freddy smith
  • 3,347
  • 5
  • 24
  • 28

2 Answers2

7

RabbitMQ v2.6.0 now supports high-availability queues using active/active clustering. Microsoft and a number of other companies have collaborated on Apache QPid which has C# bindings and which also supports active/active HA clustering.

Jonathan Oliver
  • 5,207
  • 32
  • 31
6

Can it be made to work like this out of the box?

No. When a node goes down, all of its connections are closed. Since AMQP connections are stateful, there's no way around this. What you could achieve is 1) broker goes down, 2) all clients disconnect, 3) clients connect to other node (masquerading as original) and are none the wiser.

On a side note, rabbit does not support active-active HA clustering at the moment. It does support active-passive clustering and a form of logical clustering (which might be what you're looking for).

scvalex
  • 14,931
  • 2
  • 34
  • 43
  • So, after the client detects that the connection is dead (is this the AlreadyClosedException?) it should just try reconnecting to the cluster and one of the remaining nodes should automatically be assigned for it to use? – freddy smith Nov 12 '10 at 01:59
  • More or less, yes. The slight wrinkle is that you need to connect to a different node in the cluster (since the original is down); you could do this with a load-balancer. After that, it's business as usual. From the client's point of view, it will see the same configuration (same queues, exchanges). – scvalex Nov 13 '10 at 01:41
  • So with a load balancer there would just appear to be one IP address to the clients but the erlang nodes themselves would all use their real IP address? – freddy smith Nov 23 '10 at 10:32
  • 1
    Did you have success with this? I'm about to attempt to do something similar. – xitrium May 27 '11 at 19:34