JBoss EAP 6.4.2没有从多个远程服务器监听

时间:2019-08-21 09:04:01

标签: jboss jms netty hornetq

我在将MDB设置为侦听Windows OS的JBoss EAP 6.4.2上的多个远程服务器时遇到问题。当我将2台服务器设置为在connectionParameters上侦听时,它仅从其中一台获取消息。

如果仅将一台服务器设置为侦听,则效果很好。但是不能同时收听2个或更多服务器。以下是我的MDB

@MessageDriven(mappedName = "TestTopicRemote", activationConfig = {   
        @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
        @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"),  
        @ActivationConfigProperty(propertyName = "destination", propertyValue = "cacheTopic"),  
        @ActivationConfigProperty(propertyName = "connectorClassName", propertyValue = "org.hornetq.core.remoting.impl.netty.NettyConnectorFactory,org.hornetq.core.remoting.impl.netty.NettyConnectorFactory"),          
        @ActivationConfigProperty(propertyName = "connectionParameters", propertyValue = "host=172.16.116.32;port=5445,host=172.16.116.107;port=5445"),
        @ActivationConfigProperty(propertyName = "user", propertyValue = "guest"),
        @ActivationConfigProperty(propertyName = "password", propertyValue = "password1")}
)

1 个答案:

答案 0 :(得分:1)

我相信您通常误解了connectionParameters激活配置属性提供的功能和MDB功能。 JBoss EAP中的JMS MDB无法直接从多个代理接收消息。

connectionParameters激活配置属性支持多个条目,但实际上仅使用一个。通常,这些条目用于群集中的所有服务器或HA对的主从服务器。

Artemis经纪人是否在集群的172.16.116.32172.16.116.107上运行?如果是这样,那么假设集群中的代理具有适当的配置,则连接到集群中任何节点的使用者都应该能够接收产生到集群中任何其他节点的消息。