You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Dolk <bj...@linkon.se> on 2018/04/25 06:04:45 UTC
Howto avoid stranded messages in a network of brokers
AMQ 5.15.3
We have configured AMQ with two brokers clustering via static uri's
---------------
BrokerA config
---------------
...
<networkConnector name="dmz-cluster" userName="${activemq.username}"
password="${activemq.password}" uri="tcp://brokerB:61616" />
...
<destinations>
<queue physicalName="DLQ" />
<queue physicalName="Test.Queue" />
</destinations>
...
--------------
BrokerB config
--------------
...
<networkConnector name="dmz-cluster" userName="${activemq.username}"
password="${activemq.password}" uri="tcp://brokerA:61616" />
...
<destinations>
<queue physicalName="DLQ" />
<queue physicalName="Test.Queue" />
</destinations>
...
Generally this works great, but there are an edgecase which gives us
problems.
1. Push 10 messages to BrokerA:Test.Queue
2. Connect a consumer to BrokerB:Test.Queue and pop a message
3. Dissconnect consumer
At this stage the messages flow over to BrokerB:Test.Queue so we end up with
9 messages on BrokerB:Test.Queue
4. Connect a consumer to BrokerA:Test.Queue
5. Try to pop a message
The consumer will not get any message AMQ will refuse to reroute the 9
already forwarded messages on BrokerB:Test.Queue back to BrokerA:Test.Queue
This is an edgecase but I can see it happening during poor networking
conditions or rolling updates for a single consumer using
failover:(brokerA;brokerB) config.
I have tested to played around with the networkTTL, but to no avail.
I am assuming this is somehow by design. Can it be configured differently or
do we have to find other ways to work around this possible scenario?
//Dolk
--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html