gpt4 book ai didi

grails - 嵌入Grails应用程序的ActiveMQ代理未监听外部连接

转载 作者:行者123 更新时间:2023-12-02 14:55:21 26 4
gpt4 key购买 nike

我已经使用grails-activemq插件将ActiveMQ代理嵌入到在Tomcat 7中运行的Grails应用程序中。问题是该代理仅侦听本地连接。 netstat -an显示如下:

tcp        0      0 127.0.0.1:61616             0.0.0.0:*                   LISTEN

I've set up JNDI in tomcat/conf/context.xml like so

<Context>
<Resource name="jms/ConnectionFactory" auth="Container"
type="org.apache.activemq.ActiveMQConnectionFactory" description="JMS Connection Factory"
factory="org.apache.activemq.jndi.JNDIReferenceFactory"
brokerURL="tcp://10.39.95.39:61616"
brokerName="LocalActiveMQBroker"/>
<Resource name="jms/letterCountQueue" auth="Container"
type="org.apache.activemq.command.ActiveMQQueue" description="letterCountQueue"
factory="org.apache.activemq.jndi.JNDIReferenceFactory" physicalName="letterCountQueue"/>
</Context>

并且grails-app / conf / spring / resources.groovy包含
import org.apache.activemq.ActiveMQConnectionFactory
import org.apache.activemq.broker.TransportConnector
import org.apache.activemq.command.ActiveMQQueue
import org.apache.activemq.xbean.XBeanBrokerService

import org.springframework.jms.core.JmsTemplate
import org.springframework.jms.connection.SingleConnectionFactory
import org.springframework.jms.listener.DefaultMessageListenerContainer

beans = {

jmsBroker(XBeanBrokerService) {
useJmx = 'false'
persistent = 'false'
transportConnectors = [new TransportConnector(uri: new URI('tcp://10.39.95.39:61616'))]
}

jmsFactory(ActiveMQConnectionFactory) {
brokerURL = 'tcp://10.39.95.39:61616'
}

notificationQueue(ActiveMQQueue, 'queue.notification')

jmsTemplate(JmsTemplate) {
connectionFactory = { SingleConnectionFactory cf ->
targetConnectionFactory = ref('jmsFactory')
}
}
}

我在哪里指定或不接受代理不侦听localhost以外的连接的默认设置?我该如何改变?

非常感谢,
李·格雷

最佳答案

我遇到了类似你的问题。尝试修改%ACTIVEMQ_HOME%/conf/activemq.xml,如下所示:

<transportConnectors>
<!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
<transportConnector name="openwire" uri="tcp://192.168.1.252: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"/>
</transportConnectors>

关于grails - 嵌入Grails应用程序的ActiveMQ代理未监听外部连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6838299/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com