You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by hodgesz <ho...@gmail.com> on 2012/02/24 01:06:21 UTC

Failover with networkConnectors

Hi,

Is it possible to use the failover construct in the networkConnectors uri? 
I have tried the following two uri values and both prevented ActiveMQ from
starting with an exception.

<networkConnectors>
            <networkConnector
uri="failover://(tcp://x.x.x.x:61618,tcp://x.x.x.x:61618)?randomize=false?useExponentialBackOff=true&amp;maxReconnectDelay=30000"/>
</networkConnectors>

<networkConnectors>
            <networkConnector
uri="static://(failover://(tcp://x.x.x.x:61618,tcp://x.x.x.x:61618)?randomize=false)?useExponentialBackOff=true&amp;maxReconnectDelay=30000"/>
</networkConnectors>

Both returned the following stack trace:

ERROR: java.lang.RuntimeException: Failed to execute start task. Reason:
java.l
ng.IllegalArgumentException: Invalid broker URI, no scheme specified: start
java.lang.RuntimeException: Failed to execute start task. Reason:
java.lang.Ill
galArgumentException: Invalid broker URI, no scheme specified: start
        at
org.apache.activemq.console.command.StartCommand.runTask(StartComman
.java:98)
        at
org.apache.activemq.console.command.AbstractCommand.execute(Abstract
ommand.java:57)
        at
org.apache.activemq.console.command.ShellCommand.runTask(ShellComman
.java:143)
        at
org.apache.activemq.console.command.AbstractCommand.execute(Abstract
ommand.java:57)
        at
org.apache.activemq.console.command.ShellCommand.main(ShellCommand.j
va:85)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcce
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.activemq.console.Main.runTaskClass(Main.java:251)
        at org.apache.activemq.console.Main.main(Main.java:107)


Any ideas would be greatly appreciated.

-Jonathan


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

Re: Failover with networkConnectors

Posted by hodgesz <ho...@gmail.com>.
Are there any drawbacks to turning on thread pools in terms of performance? 
It would seem like it would use less memory but might have switching costs.

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

Re: Failover with networkConnectors

Posted by hodgesz <ho...@gmail.com>.
Thanks for pointing this out Laures as we are using 5.5.1. We will definitely
add this case to our failure mode testing and use your thread pool
workaround if we experience the issue. 

I am curious if using the NIO transport as we do makes any difference. I
doubt it since it still uses TCP to make the connection for the bridge.

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

Re: Failover with networkConnectors

Posted by Laures <ba...@googlemail.com>.
please note that if you are using activemq 5.5 there is a bug in the failover
mechanism that can keep your network bridges from beeing created.

see: https://issues.apache.org/jira/browse/AMQ-3575

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

Re: Failover with networkConnectors

Posted by hodgesz <ho...@gmail.com>.
Thanks for your reply!  I noticed I had the trailing ')' in the incorrect
spot based on your example.  It is working now.  

The start issue was getting my Windows and Linux environments confused and
typing 'activemq start' in Windows.

-Jonathan


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

Re: Failover with networkConnectors

Posted by mserrano <ma...@attivio.com>.
I'm using:



Note, no // after the static.   But it looks like something else is
misconfigured for you.  Notice the /start/ after no scheme specified.


hodgesz wrote
> 
> ERROR: java.lang.RuntimeException: Failed to execute start task. Reason:
> java.l
> ng.IllegalArgumentException: Invalid broker URI, no scheme specified:
> start
> java.lang.RuntimeException: Failed to execute start task. Reason:
> java.lang.Ill
> galArgumentException: Invalid broker URI, no scheme specified: start
> 


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