The failover transport will retry forever by default, so a failure to connect will never result in control being returned to your code. If you want that, you can set the maxReconnectAttempts URI option to return control after a certain number of successive failures. See http://activemq.apache.org/failover-transport-reference.html for details.
I don't know what exactly the timeout URI option does (the description on the wiki doesn't make that clear to me), but it doesn't sound to me like what you're looking for. Tim On Jul 8, 2015 5:13 PM, "mport9491" <mport9...@gmail.com> wrote: > My producer resides in a web application. The failover switch works as > intended, however, when both of my ActiveMQ brokers are down, it doesn't > seem to "timeout" and just throw an exception. What I want to achieve is a > non-blocking producer. > > My broker URL is basically: > failover:(tcp://10.0.112.49:61616,tcp://localhost:61616)?timeout=1000. > > I'm expecting it to timeout after one second when both brokers are down but > unfortunately it does not timeout and it just blocks. > > Am I understanding the concept of timeout right? > > > > -- > View this message in context: > http://activemq.2283324.n4.nabble.com/If-my-ActiveMQ-brokers-are-down-how-do-I-tell-my-producer-to-stop-blocking-the-thread-tp4698835.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. >