From 6ed942a3eec957658074741ed6ab74cb62d9a795 Mon Sep 17 00:00:00 2001 From: Gary Tully Date: Fri, 10 Dec 2010 13:07:00 +0000 Subject: [PATCH] fix regression with DiscoveryTransportNoBrokerTest - https://issues.apache.org/jira/browse/AMQ-3049 - reconnectDelay of -1 not appropriate for sleep git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1044340 13f79535-47bb-0310-9956-ffa450edef68 --- .../activemq/transport/failover/FailoverTransport.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java b/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java index f8fff877fd..796d6f56d8 100755 --- a/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java +++ b/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java @@ -70,7 +70,7 @@ import org.apache.commons.logging.LogFactory; public class FailoverTransport implements CompositeTransport { private static final Log LOG = LogFactory.getLog(FailoverTransport.class); - + private static final int DEFAULT_INITIAL_RECONNECT_DELAY = 10; private TransportListener transportListener; private boolean disposed; private boolean connected; @@ -90,7 +90,7 @@ public class FailoverTransport implements CompositeTransport { private final TaskRunner reconnectTask; private boolean started; private boolean initialized; - private long initialReconnectDelay = 10; + private long initialReconnectDelay = DEFAULT_INITIAL_RECONNECT_DELAY; private long maxReconnectDelay = 1000 * 30; private double backOffMultiplier = 2d; private long timeout = -1; @@ -99,7 +99,7 @@ public class FailoverTransport implements CompositeTransport { private int maxReconnectAttempts; private int startupMaxReconnectAttempts; private int connectFailures; - private long reconnectDelay = -1; + private long reconnectDelay = DEFAULT_INITIAL_RECONNECT_DELAY; private Exception connectionFailure; private boolean firstConnection = true; // optionally always have a backup created @@ -805,7 +805,7 @@ public class FailoverTransport implements CompositeTransport { if (connectList.isEmpty()) { failure = new IOException("No uris available to connect to."); } else { - if (!useExponentialBackOff || reconnectDelay == -1) { + if (!useExponentialBackOff || reconnectDelay == DEFAULT_INITIAL_RECONNECT_DELAY) { reconnectDelay = initialReconnectDelay; } synchronized (backupMutex) {