连接到ActiveMQ表单grails

时间:2014-12-16 13:32:21

标签: grails groovy activemq

我正在尝试从Grails应用程序连接到远程ActiveMQ服务器。 但是我得到了这个错误:

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

ActievMQ服务器的传输配置为:

   <transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
        <transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
        <transportConnector name="stomp" uri="stomp://0.0.0.0:61613?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
        <transportConnector name="mqtt" uri="mqtt://0.0.0.0:1883?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
        <transportConnector name="ws" uri="ws://0.0.0.0:61614?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>

Resources.groovy:

beans = {
jmsConnectionFactory(SingleConnectionFactory) {
    targetConnectionFactory = { ActiveMQConnectionFactory cf ->
        brokerURL = "failover:(tcp://brokerIpAddress:61616?connectionTimeout=5000)?maxReconnectDelay=5000&startupMaxReconnectAttempts=5"
    }
}}

1 个答案:

答案 0 :(得分:0)

这是一个网络问题,该机器无法访问activeMQ服务器。它现在一切都很好,它与我最初发布的conf一起工作。