You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by abhijith <to...@gmail.com> on 2016/05/11 22:58:27 UTC
Artemis failover on initial connection
Hi,
I have a HA cluster with one master and one slave. I am creating connection
factory with below settings.
HashMap<String, Object> map = new HashMap<String, Object>();
map.put("host", "artemis01-mydev");
map.put("port", "61616");
map.put(TransportConstants.SSL_ENABLED_PROP_NAME, true);
TransportConfiguration server1 = new
TransportConfiguration(NettyConnectorFactory.class.getName(), map);
HashMap<String, Object> map2 = new HashMap<String, Object>();
map2.put("host", "artemis02-mydev");
map2.put("port", "61616");
map.put(TransportConstants.SSL_ENABLED_PROP_NAME, true);
TransportConfiguration server2 = new
TransportConfiguration(NettyConnectorFactory.class.getName(), map2);
ActiveMQConnectionFactory cf =
ActiveMQJMSClient.createConnectionFactoryWithHA(JMSFactoryType.CF, server1,
server2);
cf.setRetryInterval(1000);
cf.setReconnectAttempts(1);
cf.setRetryIntervalMultiplier(1.0);
cf.setInitialConnectAttempts(1);
cf.setFailoverOnInitialConnection(true);
cf.setCallTimeout(2000);
Problem is connection factory is trying to receive cluster topology from
slave which is 'artemis02-dev' and errors out. Its not falling back to
master to receive the topology. It works fine if it connects to master
first time itself.
I thought by setting setFailoverOnInitialConnection() will do that. I am
not able to figure out how to solve this. Any help is greatly appreciated.
Thanks
Abhi
--
View this message in context: http://activemq.2283324.n4.nabble.com/Artemis-failover-on-initial-connection-tp4711844.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.