activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Bain <>
Subject Static: network connectors and maxReconnectAttempts
Date Wed, 24 Sep 2014 19:20:53 GMT
Gary, Torsten, and others have said in various places that broker-to-broker
networkConnectors should set maxReconnectAttempts=0 to allow reconnection
to be handled by the network bridge.  (Sources: 1
Torsten (link 1) was talking about static: network connectors, while Gary's
quotes in the other two links were related to failover: (or masterslave:,
which is just chrome on top of failover:), but if it's a requirement of the
network bridge that it be the one to re-establish the question, it
shouldn't matter what the underlying transport is.

It's obvious in FailoverTransport
how maxReconnectAttempts=0 gets processed to mean "don't try to reconnect",
allowing the network bridge to re-establish the connection, and there are
notes in
explaining that this interpretation of the value "0" was implemented in
5.6.0 (  There's no similar
code in SimpleDiscoveryAgent
(which handles connection attempts for the static: transport
<>, as I
understand it) to interpret "-1" as "reconnect forever" and "0" as "don't

Is Gary's and Torsten's advice about maxReconnectAttempts not applicable to
static: network connectors for some reason that I'm not understanding?  Or
should the changes Gary made in AMQ-3542 have been applied to all protocols
that include reconnection attempts?  (Do I need to open a JIRA for this?)

And a related question: when using the static: transport to establish a
broker mesh, if we set maxReconnectAttempts=0, is there a way to perform
exponential backoff at the network bridge, so it doesn't continually try to
reconnect (and spam the logs) when one broker in the mesh is offline for a
while?  The only way I see to control exponential backoff is within the
static: transport via the useExponentialBackOff=true option; searching the
source code (I'm looking at 5.8.0), I don't see any references to
exponential backoff in any code that seems to be related to network


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message