【发布时间】:2018-07-11 16:21:34
【问题描述】:
我有两个 JMS 服务器,它们在一个独立的全 ha 环境中作为一个 JMS 集群链接在一起。这些服务器托管我的 JMS-Destinations(我们称它们为 JMS-Master)。
另外还有一个服务器被配置为独立完整服务器(我们将其命名为 JMS-Slave)。这个服务器有一个 JMS-Bridge 到一个 JMS-Topic。
对于这个配置,我在 JMS-Slave 创建了两个到远程服务器的套接字绑定:
<outbound-socket-binding name="remote-server-1">
<remote-destination host="a.b.c.d" port="8080"/>
</outbound-socket-binding>
<outbound-socket-binding name="remote-server-2">
<remote-destination host="a.b.c.d" port="18080"/>
</outbound-socket-binding>
我在消息子系统配置的两个 http 连接器上使用它们:
<http-connector name="remote-1-http-connector" socket-binding="remote-server-1" endpoint="http-acceptor"/>
<http-connector name="remote-2-http-connector" socket-binding="remote-server-2" endpoint="http-acceptor"/>
我创建了一个池连接工厂:
<pooled-connection-factory name="remote-connection" entries="java:/jms/remoteCF" connectors="remote-1-http-connector remote-2-http-connector" user="testuser" password="testpassword" failover-on-initial-connection="true"/>
最后我配置了 JMS-Bridge:
<jms-bridge name="HelloWorldQueue-jms-bridge" quality-of-service="DUPLICATES_OK" failure-retry-interval="5000" max-retries="-1" max-batch-size="10" max-batch-time="100">
<source connection-factory="ConnectionFactory" destination="queue/HelloWorldQueue"/>
<target connection-factory="jms/RemoteConnectionFactory" destination="queue/HelloWorldQueue" user="heinz" password="becker" >
<target-context>
<property name="java.naming.factory.initial" value="org.jboss.naming.remote.client.InitialContextFactory"/>
<property name="java.naming.provider.url" value="http-remoting://a.b.c.d:8080, http-remoting://a.b.c.d:18080"/>
</target-context>
</target>
</jms-bridge>
结果:
- 如果两个 JMS-Master 服务器都启动并且我启动了 JMS-Slave, 一切正常。
- 如果其中一台 JMS-Master 服务器出现故障并且我启动了 JMS-Slave,它 也可以。 jms-bridge 连接到可用节点。
- 但是如果我关闭了 JMS-Slave 的 JMS Bridge 所连接的节点 已连接,没有故障转移。
我正在寻找一种配置,其中 JMS-Bridge 在与可用节点崩溃后“重新连接”,而不是将其与 JMS-Master 进入同一个集群。
我怎样才能做到这一点?还有其他可能获得类似行为吗?或者是否有关于完全不同的设置的建议?
【问题讨论】:
-
虽然只是稍微相关,但当我测试供应商 JMS 客户端与 HA 域中我们的 4 个服务器节点的连接时,当拓扑发生更改时,拓扑更改更新已发送,如果我没记错的话,然后 JMS 客户端将切换到另一个节点。我知道这没有多大帮助。我想知道您是否可以打开一些调试并查看 not 发生了什么
标签: java jakarta-ee wildfly wildfly-10