java - ActiveMQ FailoverTransport reconnecting too fast on Linux compared to Windows -


i have 1 activemq broker on linux machine , standalone java application acts producer running on windows machine. both windows , linux machines using same version of java 7.

i specify broker url be:

failover://(tcp://10.0.112.49:61616)?timeout=1000&warnafterreconnectattempts=1&maxreconnectattempts=0` 

windows scenario: start application , automatically connects activemq broker. when stop broker, failovertransport tries reconnect every second.

2015-07-16 15:14:52,737 error [activemq task-1] (failovertransport.java:1099) csn: failed connect [tcp://10.0.112.49:61616] after: 1 attempt(s)

this expected behavior.

however, when run application on linux, instead of trying reconnect every second, reconnects every 5-10 milliseconds! wondering why behavior different.

your problem don't understand timeout option. here documentation says

timeout

enables timeout on send operations (in miliseconds) without interruption of reconnection process

however in configuring activemq-cpp think described better (but still same).

timeout

if send blocked waiting on failed connection reconnect how long should wait before failing send, default forever (-1).

if have understand you, options want initialreconnectdelay, maxreconnectdelay , useexponentialbackoff.

see also:

  1. how configure automatic reconnection
  2. how can support auto reconnection
  3. using activemq failover uri reconnecting, while timeout on first connection

Comments

Popular posts from this blog

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

php - Zend Framework / Skeleton-Application / Composer install issue -