Hi all,
In my domain there is a cluster of 2 brokers and several CMS clients. The
failover protocol works very well when i switch off ActiveMQ on one of the
brokers, but not *when I unplug the network cable* from the server. In this
case, it takes about 10 seconds to switch to the other node, whereas I need
the client switches in 1-2 seconds. I have also configured the inactivity
monitor set to 1 second, but the 10 seconds delay in the switching persists.
Now this is my uri:

failover://(tcp://BROKER1:61616,tcp://BROKER2:61616)?randomize=false""&wireFormat.maxInactivityDuration=1000&wireFormat.maxInactivityDurationInitalDelay=1000

After several tests, I believe to have understood the reason the delay in
the switching on the other server. Once the cable is disconnected, the
inactivity monitor detects the disconnection after 1 second and the client
tries to close the socket; however the server can't answer and the socket
remains in *FIN_WAIT_1* status for about ten seconds. After the socket is
finally closed and the client switches to the other broker.

Based on my tests, no one of the available options of the CMS library can
force the client to close immediately the socket. The only option useful
seems to be *backup=true*, which requires the client to establish a
connection for each broker of the cluster. Adding this option, the
connection is successful and I can see both sockets established; the first
one is used for exchanging the messages, while the other one only for
keepAliveInfo messages as required by the inactivity monitor. When I unplug
the cable from the first broker, the client looses forever the connection
for the most part of the times. When rarely it works, the switching is very
fast as I want. Therefore I'm confident this is the right option for my
needs, but it seems affected by a bug.

Have you ever experienced the *backup=true* option for failover transport?
Any issue reported about this option?

Thank you in advance for your help.




--
View this message in context: 
http://activemq.2283324.n4.nabble.com/Backup-option-not-working-in-CMS-tp4716711.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to