title: Connecting to ActiveMQ form grails
body: <p>I am trying to connect to a remote ActiveMQ server from my Grails app.
  But I get this error:</p>
  
  <pre><code>ERROR failover.FailoverTransport  - Failed to connect to transport after: 5 attempt(s)
  could not refresh JMS Connection for destination 'queue' - retrying in 5000 ms.
  Cause: The JMS connection has failed: connect timed out
  </code></pre>
  
  <p>Transport configuration of the ActievMQ server is :</p>
  
  <pre><code>   &lt;transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000&amp;amp;wireFormat.maxFrameSize=104857600"/&gt;
          &lt;transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&amp;amp;wireFormat.maxFrameSize=104857600"/&gt;
          &lt;transportConnector name="stomp" uri="stomp://0.0.0.0:61613?maximumConnections=1000&amp;amp;wireFormat.maxFrameSize=104857600"/&gt;
          &lt;transportConnector name="mqtt" uri="mqtt://0.0.0.0:1883?maximumConnections=1000&amp;amp;wireFormat.maxFrameSize=104857600"/&gt;
          &lt;transportConnector name="ws" uri="ws://0.0.0.0:61614?maximumConnections=1000&amp;amp;wireFormat.maxFrameSize=104857600"/&gt;
  </code></pre>
  
  <p>Resources.groovy:</p>
  
  <pre><code>beans = {
  jmsConnectionFactory(SingleConnectionFactory) {
      targetConnectionFactory = { ActiveMQConnectionFactory cf -&gt;
          brokerURL = "failover:(tcp://brokerIpAddress:61616?connectionTimeout=5000)?maxReconnectDelay=5000&amp;startupMaxReconnectAttempts=5"
      }
  }}
  </code></pre>