Search code examples
activemq-classicfailover

ActiveMQ - failover and useAsyncSend


Application hang on connection, when the ActiveMQ is down.

URL: failover:(tcp://localhost:61616)?jms.useAsyncSend=true

Can I somehow proceed with each connection with failover and async to not block thread when trying to send the message?


Solution

  • The failover transport will not buffer sends as that can lead to OOM issues so even in the case of configured async sends the send will block until there is a connection and the transport can get the data onto the wire. If you really want the send to not block until reconnection the failover transport does have a timeout option for send which will cause them to fail but then your application needs to be able to deal with failed sends and retries etc so there is no silver bullet here.