我有以下问题:我有几个带有本地 ActiveMQ 代理的站点,该代理转发到远程代理(在数据中心中)。这种连接通常不稳定,每月会中断几次,每次几分钟或几小时。
因此,如果此时无法访问远程代理,则消息需要在本地代理上等待。
我有以下 ActiveMQ 配置:
<networkConnectors>
<networkConnector uri="static://(tcp://my-remote-broker:61616)"
name="myremotebroker" dynamicOnly="false"
conduitSubscriptions="true"
decreaseNetworkConsumerPriority="false">
<!-- Exclude all destinations by default -->
<excludedDestinations>
<queue physicalName=">" />
<topic physicalName=">" />
</excludedDestinations>
<!-- Only forward these to our connection -->
<staticallyIncludedDestinations>
<topic physicalName="MySpecialTopic"/>
</staticallyIncludedDestinations>
</networkConnector>
</networkConnectors>
这会将消息从本地代理(主题 MySpecialTopic)转发到远程代理。这在连接稳定时有效。
但是,我尝试暂时禁用 Internet 连接,以使本地代理失去与远程代理的连接。那时我发送了一条新消息,该消息已在本地代理上排队,但从未到达远程代理,即使在本地代理重新连接后也是如此!
我缺少 ActiveMQ 配置中的某些内容吗?
谢谢!