Unfortunately, you can't have it both ways with the failover transport as it cannot know what the application wants.
That is -- either the failover transport tries forever (my preferred approach), or it fails and stops trying to reconnect after some time. If you are looking to have individual message sends fail after timeout when the broker is unreachable for an extended period of time, perhaps the following strategy could work for you: - Set a TTL on the message that matches the send timeout (probably with a little extra time added so a message doesn't expire immediately after being sent in the worst-case-scenario) - Add a TransportListener to the ActiveMQConnectionFactory to log, and take any necessary action, when the transport disconnects from the broker - Use an in-memory queue with a separate thread that's dedicated to performing the JMS send to ActiveMQ, using futures (or similar synchronization) to notify the original thread when the timeout or success send occurs Alternatively, you can use the failover transport with timeout and add reconnect logic to your application. This seems counter-intuitive to me since that's the failover transport's main job in life. Hope this helps. Art On Thu, Mar 28, 2019 at 3:34 AM tal.cohen2 <tal.coh...@nice.com> wrote: > but i want that when the broker will be available again he will try to > reconnect (as failover suppose to work) > > > > > -- > Sent from: > http://activemq.2283324.n4.nabble.com/ActiveMQ-Dev-f2368404.html >