I am trying to use Apache Camel and the Qpid JMS client to connect to an ActiveMQ Artemis active-active cluster running in two different nodes (VM's). I'm using ActiveMQ Artemis 2.17.0.
Broker1 --- Host1:5672 (active)
Broker2 --- Host2:5672 (active)
I'm trying to figure out what should be the remoteURI configuration for my org.apache.qpid.jms.JmsConnectionFactory instance. Using ampq://host1:5672,ampq://host2:5672 didn't work. I haven't seen any reference in the documentation.
I want the producer to push messages to both the brokers either by Round-robin or default way, and I want the consumer to consume those message from both brokers either in load balanced way.
For master-backup configuration the below worked:
<bean id="jmsampqConnectionFactory" class="org.apache.qpid.jms.JmsConnectionFactory">
<property name="remoteURI" value="failover:(ampq://host1:5672,ampq://host2:5672)" />
<property name="username" value="user"/>
<property name="password" value="pass"/>
</bean>
For a master-slave configuration this worked. So when the master is active the client sent messages to master, when master is down the client pushed messages to slave. We didn't had any issues there. However, for active-active this won't work. What URL should I use?
For reference, broker configuration is the same as in my previous Stack Overflow question.
The Qpid JMS client does not currently have (nor will it ever have) a fan-out or fan-in style connection handler to automatically handle this case as described. The client creates a single connection to a broker and will; if using failover, reconnect to another provided broker URI which is why the primary / secondary configuration you described worked but the active / active one doesn't.
You could probably solve this in other ways such as camel routes that probably could manage to do something along these lines or you could create you own JMS layer that creates a fan-out and fan-in style connection proxy. How you'd accomplish this is outside the scope of the question though.