Pieter
Pieter

Reputation: 3399

Load balancing in ActiveMQ network of brokers

We are using ActiveMQ and have defined a network of brokers (2 in our test setup). We have configured the brokers to accept AMQP connections and we have enable "updateClusterClients" and "rebalanceClusterClients" like so:

<transportConnector name="amqp" uri="amqp+ssl://0.0.0.0:5673?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600&amp;transport.transformer=jms" updateClusterClients="true" rebalanceClusterClients="true"/>

Furthermore, we have build our clients using Qpid JMS. The clients have been configured using a failover-url.

The clients can communicate with each other just fine. Also, when I stop one of the two brokers, they switch to the remaining broker.

However, when I restart the broker, I had expected to see some of the clients move to the new broker. Unfortunately, what I actually see is that they all stay connected to the same broker.

What might be the reason that they don't rebalance themselves? Also, I would like the clients to spread over the two brokers when they connect initially. Is there a way how I can achieve this?

Upvotes: 2

Views: 714

Answers (1)

Tim Bish
Tim Bish

Reputation: 18356

The ActiveMQ broker does not attempt to rebalance the AMQP clients in the Broker network. There could be a way to accomplish it but it makes some assumptions about the nature of every AMQP client that's connect such as the fact that they all support connection redirects which not all of them do.

Until a better mechanism is defined such that a client can connect and advertise that it is willing to be redirected I don't think you'll see ActiveMQ forcibly dropping connections on AMQP clients to rebalance them.

The broker is able to rebalance OpenWire clients because it knows that an OpenWire client connected with the failover transport will deal with the Connection Control command that requests the client to leave, where a client that is not connect with failover will ignore that command.

Upvotes: 1

Related Questions