0
votes

I am trying to setup 2 ActiveMQ Artemis servers with support for HA and failover. But what I can see in the documentation and in this example is that Artemis is not scaleable since I have to set up connections and sessions to each Artemis node in the code. That means if I would like to scale Artemis by adding a third server, then I would have to make a new release of the code where connections and sessions to that server exist, right?

Does that also mean that I manually have to create a new connection and a new session the the failed server when it is up and appears on the cluster again?

2

2 Answers

1
votes

To scale in this way you must use a discovery group which uses UDP multicast or even JGroups.

You can then setup the discovery configuration on the application side to discover the Artemis nodes. All of this is described, with examples, in the Clustering section of the documentation.

0
votes

The example you cited is demonstrating (in part) how it's possible to consume all the messages from both servers after a node failure when using the STRICT <message-load-balancing>. It isn't an example for general purpose client configuration when using a cluster.

You certainly do not need to connect to every node in the cluster. In a normal clustered environment you'd have lots of different clients connected to just one of the cluster nodes which would ensure efficient consumption of messages. See the clustering documentation for more details on configuring the broker for clustering and the impact of that configuration on clients.

In the case of fail-over you simply need to configure your connection for HA (e.g. tcp://host:61616?ha=true) and it will automatically connect to the slave if the master node fails. See the HA documentation for more details on configuring the broker for high availability.