activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Tully <>
Subject Re: Static: network connectors and maxReconnectAttempts
Date Thu, 25 Sep 2014 15:21:44 GMT
maxReconnectAttempts=0 relates to the use of failover only, where you use
failover to choose between a list of broker urls (typically a pair for
master slave). masterSlave sets maxReconnectAttempts=0 on the underlying
failover url.
The static discovery, which is implemented by the SimpleDiscoveryAgent can
do retries and backoff etc.

The network bridge is a discovery listener, it gets told to add/remove
services (urls) that are discovered/retried.

On 24 September 2014 20:20, Tim Bain <> wrote:

> 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
> <
> >,
> 2
> <
> >,
> 3
> <
> >)
> 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
> reconnect".
> 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
> bridges...
> Thanks,
> Tim


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