[rabbitmq-discuss] question about cluster failover

Ben Hood 0x6e6562 at gmail.com
Mon Nov 3 23:42:33 GMT 2008


Anonymous,

On Mon, Nov 3, 2008 at 9:48 PM, Alexis Richardson
<alexis.richardson at cohesiveft.com> wrote:
> What host parameter do I specify in ConnectionFactory API?

The host name or IP address of one of the brokers in the cluster. DNS
round robins may be a suitable strategy in this scenario.

There is no transparent failover mechanism in the Java client. For
architectural reasons, this problem *should* be handled by higher
level application or supervision code. Although this thread
(http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/2008-October/002105.html)
centers around the Erlang client, the reasoning is analogous for the
Java client.

> Assume subscriber application creates a number of subscriptions and
> publisher application publishes on them. One of the hosts in the
> cluster goes down. Is this transparent to my Java applications?

Not from the client library perspective, as indicated above.

> Are
> the subscriptions preserved on the second host in the cluster?

No, the subscriptions are local to the queue process, which may have
died if the queue resides on the node that died. There is a concept of
persistent sessions in 0-10, but I have no knowledge of this version.

> Assume I have many publishers messaging with many consumers at some
> constant rate for each publisher. Will adding hosts to the cluster
> increase the capacity of the system linearly in terms of max number of
> consumers and producers? Can you explain?

I am not aware of any empirical evidence about Rabbit that could
support such a claim.

However, by clustering, you can spread the load of ingress routing. On
egress, queues are not load balanced, meaning that queue entities
reside on one particular node, so in a pathological scenario, where
the entire message load is routed to one particular queue, clustering
will balance not balance this out. Wisely chosen routing keys or a
custom exchange may be able to solve this.

I recently answered a question that is related to this - the prospect
of a custom load balancing exchange in a global scale scenario - see
http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/2008-October/002136.html

As indicated in that thread, at global scale you may face the eventual
consistency dilemma.

But just to make sure that I understand your question correctly, are
you primarily interested in load balancing end to end message routing
or are you more concerned about the maximum number of clients that can
connect to the cluster (as indicated in your question)?

HTH,

Ben




More information about the rabbitmq-discuss mailing list