title: ActiveMQ timeout at connection
body: <p>I have the following problem:
  I try to connect to an ActiveMQ broker (which is now down) using the following piece of code</p>
  
  <pre><code>connectionFactory = new ActiveMQConnectionFactory(this.url + "?timeout=2000");
  connection = connectionFactory.createConnection();
  connection.start();
  session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
  LOGGER.info("Connected to " + this.url);
  </code></pre>
  
  <p>The problem is that the timeout does not have any effect</p>
  
  <pre><code>connection.start()
  </code></pre>
  
  <p>is blocked forever.
  I inspected ActiveMQ log and found the following info:</p>
  
  <pre><code>2013-12-20 01:49:03,149 DEBUG [ActiveMQ Task-1] (FailoverTransport.java:786) - urlList connectionList:[tcp://localhost:61616?timeout=2000], from: [tcp://localhost:61616?timeout=2000]
  2013-12-20 01:49:03,149 DEBUG [ActiveMQ Task-1] (FailoverTransport.java:1040) - Connect fail to: tcp://localhost:61616?timeout=2000, reason: java.lang.IllegalArgumentException: Invalid connect parameters: {timeout=2000}
  </code></pre>
  
  <p>The timeout parameter is specified here <a href="http://activemq.apache.org/cms/configuring.html" rel="nofollow noreferrer">http://activemq.apache.org/cms/configuring.html</a> </p>
  
  <p>Has anybody any idea how to pass timeout argument to ActiveMQConnectionFactory?
  Or how to set a timeout for connection.start() ?
  Thank you!</p>
  
  <p><strong>Update</strong>: I found this on Stackoverflow: <a href="https://stackoverflow.com/questions/11775741/activemq-createsession-failover-timeout-after-a-connection-is-resumed?rq=1">ActiveMQ - CreateSession failover timeout after a connection is resumed</a> . I tried it but the following exception is thrown: </p>
  
  <pre><code>javax.jms.JMSException: Could not create Transport. Reason: java.lang.IllegalArgumentException: Invalid connect parameters: {transport.timeout=5000}
  at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:35)
  </code></pre>
  
  <p>I use ActiveMQ 5.8.0 from maven repo</p>