activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ByteFlinger <>
Subject How to make ActiveMQ libs remember failover settings?
Date Mon, 16 Sep 2013 09:50:33 GMT

I have an application which is configured to put a message in a queue using
failover to 2 different servers. The idea is that it will always try to send
to server1 first and if it fails it should failover and send to server2
instead, until server1 comes up again at which point it should fail back
over to server1.

The connection string I am using is the following:


I am also not using the JEE connection pool abstract so I am using
ActiveMQ's PoolingConnectionFactory instead.

The issue here is that, if I bring server1 down, the application correctly
fails over to server2 however my issues is that after a certain amount of
time has passed rather than sending new messages immediately to server2, it
will once again try to connect first to server1 which will take some time to
timeout and then swap over to server2.

Why does it not remember that server1 is down (specially given the fact that
there is a thread in the background trying to check if it is up or down)?
How would I fix that?

I noticed that the time it takes for it to "forget" this is the time it
takes for the connection in the pool to expire. I am guessing that telling
the PoolingConnectionFactory to never expire the threads would probably
solve the issue but is that the proper solution? What is the impact of
having this thread open at all times?

Is there a way to tell the pool to open up a default amount of connections
by default upon start or is it normal to have the threads open dynamically
as producers put messages on them?

Any help on the matter is appreciated.

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message