ActiveMQ: How to handle broker failovers while using temporary queues

前端 未结 2 1330
陌清茗
陌清茗 2020-12-23 09:22

On my JMS applications we use temporary queues on Producers to be able to receive replies back from Consumer applications.

I am facing exactly same issue on my end as

2条回答
  •  無奈伤痛
    2020-12-23 10:10

    There is a broker attribute, org.apache.activemq.broker.BrokerService#cacheTempDestinations that should help in the failover: case. Set that to true in xml configuration, and a temp destination will not be removed immediately when a client disconnects. A fast failover: reconnect will be able to producer and/or consume from the temp queue again.

    There is a timer task based on timeBeforePurgeTempDestinations (default 5 seconds) that handles cache removal.

    One caveat though, I don't see any tests in activemq-core that make use of that attribute so I can't give you any guarantee on this one.

提交回复
热议问题