问题
We have a network of four brokers, 2 "front-end" and 2 "back-end" (I'll refer to them as FB1 FB2 BB1 BB2). They are networked in a square like so:
FB1 .... FB2
. .
. .
. .
BB1 .... BB2
The network connections are set to exclude specific queues but otherwise allow forwarding of all other queues and topics. The network connectors have failover defined between front-end and back-end so if, for example, BB1 went down then FB1 should failover and establish a new network connection to BB2.
Clients connecting to each pair also use failover so that if one of the pair goes down they are meant to failover to the other and continue communication. i.e. client connects to FB1, FB1 fails, client failover to FB2.
In my problem scenario a client sends a InOut (request-reply) message to the front-end brokers. The front-end brokers forward this message to the back-end brokers, where it is consumed and a response generated. The response is then fed back via temporary queues to the original client.
If i kill one of the brokers during this exchange, then clients failover successfully to the others. However, subsequent IntOut (request-reply) message fail and I see exceptions like:
org.springframework.jms.InvalidDestinationException: Cannot publish to a deleted Destination: temp-queue://I...
Can anyone explain why this would happen and how I can prevent it?
回答1:
Temporary queues are not clustered. When you do request/reply you need to add some logic that recreate the temp queue for InOut in case of a failover - this does not happen automatic.
来源:https://stackoverflow.com/questions/29750189/activemq-failover-with-temporary-queues-on-a-network-of-brokers