You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by ajb <al...@gmail.com> on 2011/04/05 19:01:38 UTC

ActiveMQ Failover URL problems

Hi,

I have a stand alone ActiveMQ Broker, the client's connection that I use is
as follows:

tcp://hostname:61616?jms.redeliveryPolicy.maximumRedeliveries=-1&jms.redeliveryPolicy.backOffMultiplier=1&jms.prefetchPolicy.durableTopicPrefetch=3000

When moving to a Master / Failover scenario, I have used the failover
transport as follows:

failover://(tcp://hostname:61615?jms.redeliveryPolicy.maximumRedeliveries=-1&jms.redeliveryPolicy.backOffMultiplier=1&jms.prefetchPolicy.durableTopicPrefetch=3000,tcp://slaveHostname:61615?jms.redeliveryPolicy.maximumRedeliveries=-1&jms.redeliveryPolicy.backOffMultiplier=1&jms.prefetchPolicy.durableTopicPrefetch=3000)?randomize=false

However when starting my application, the following exception is thrown:

javax.jms.JMSException: Could not create Transport. Reason:
java.io.IOException: Invalid location: failover://hostname:61615
	at
org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:35)
	at
org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnectionFactory.java:242)
	at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:255)
	at
org.apache.activemq.ActiveMQConnectionFactory.createTopicConnection(ActiveMQConnectionFactory.java:212)
	at
com.detica.analyzer.EnterpriseCollectionIndexManager.(EnterpriseCollectionIndexManager.java:364)
	at
com.detica.analyzer.EnterpriseIndexServer.addCollectionIndexManager(EnterpriseIndexServer.java:1050)
	at
com.detica.analyzer.EnterpriseIndexServer.access$14(EnterpriseIndexServer.java:1015)
	at
com.detica.analyzer.EnterpriseIndexServer$CollectionUpdateTask.run(EnterpriseIndexServer.java:761)
	at java.util.TimerThread.mainLoop(Timer.java:512)
	at java.util.TimerThread.run(Timer.java:462)
Caused by: java.io.IOException: Invalid location: failover://hostname:61615
	at
org.apache.activemq.transport.failover.FailoverTransportFactory.doConnect(FailoverTransportFactory.java:42)
	at
org.apache.activemq.transport.TransportFactory.doConnect(TransportFactory.java:51)
	at
org.apache.activemq.transport.TransportFactory.connect(TransportFactory.java:80)
	at
org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnectionFactory.java:240)
	... 8 more

When I use a failover transport without any additional parameters as shown
below, no exceptions are thrown.

failover://(tcp://hostname:61615,tcp://slaveHostname:61615)?randomize=false

How do I add additional parameters to the connection string when using the
failover transport?

Thank you,

Ali


--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-Failover-URL-problems-tp3428623p3428623.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

RE: ActiveMQ Failover URL problems

Posted by "Nakarikanti, Nageswara" <NN...@dwd.IN.gov>.
 
I see your additional parameters were same on both ActiveMQs, Try using them besides 'randomize=false'


i.e. after you apecify your activemq machines...

I am not sure but give a try.

-Nag.
-----Original Message-----
From: ajb [mailto:alistairjbastian@gmail.com] 
Sent: Tuesday, April 05, 2011 1:02 PM
To: users@activemq.apache.org
Subject: ActiveMQ Failover URL problems

Hi,

I have a stand alone ActiveMQ Broker, the client's connection that I use is as follows:

tcp://hostname:61616?jms.redeliveryPolicy.maximumRedeliveries=-1&jms.redeliveryPolicy.backOffMultiplier=1&jms.prefetchPolicy.durableTopicPrefetch=3000

When moving to a Master / Failover scenario, I have used the failover transport as follows:

failover://
(tcp://hostname:61615?jms.redeliveryPolicy.maximumRedeliveries=-1&jms.redeliveryPolicy.backOffMultiplier=1&jms.prefetchPolicy.durableTopicPrefetch=3000,

tcp://slaveHostname:61615?jms.redeliveryPolicy.maximumRedeliveries=-1&jms.redeliveryPolicy.backOffMultiplier=1&jms.prefetchPolicy.durableTopicPrefetch=3000)?randomize=false


However when starting my application, the following exception is thrown:

javax.jms.JMSException: Could not create Transport. Reason:
java.io.IOException: Invalid location: failover://hostname:61615
	at
org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:35)
	at
org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnectionFactory.java:242)
	at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:255)
	at
org.apache.activemq.ActiveMQConnectionFactory.createTopicConnection(ActiveMQConnectionFactory.java:212)
	at
com.detica.analyzer.EnterpriseCollectionIndexManager.(EnterpriseCollectionIndexManager.java:364)
	at
com.detica.analyzer.EnterpriseIndexServer.addCollectionIndexManager(EnterpriseIndexServer.java:1050)
	at
com.detica.analyzer.EnterpriseIndexServer.access$14(EnterpriseIndexServer.java:1015)
	at
com.detica.analyzer.EnterpriseIndexServer$CollectionUpdateTask.run(EnterpriseIndexServer.java:761)
	at java.util.TimerThread.mainLoop(Timer.java:512)
	at java.util.TimerThread.run(Timer.java:462)
Caused by: java.io.IOException: Invalid location: failover://hostname:61615
	at
org.apache.activemq.transport.failover.FailoverTransportFactory.doConnect(FailoverTransportFactory.java:42)
	at
org.apache.activemq.transport.TransportFactory.doConnect(TransportFactory.java:51)
	at
org.apache.activemq.transport.TransportFactory.connect(TransportFactory.java:80)
	at
org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnectionFactory.java:240)
	... 8 more

When I use a failover transport without any additional parameters as shown below, no exceptions are thrown.

failover://(tcp://hostname:61615,tcp://slaveHostname:61615)?randomize=false

How do I add additional parameters to the connection string when using the failover transport?

Thank you,

Ali


--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-Failover-URL-problems-tp3428623p3428623.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.