activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r1044340 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java
Date Fri, 10 Dec 2010 13:07:00 GMT
Author: gtully
Date: Fri Dec 10 13:07:00 2010
New Revision: 1044340

URL: http://svn.apache.org/viewvc?rev=1044340&view=rev
Log:
fix regression with DiscoveryTransportNoBrokerTest - https://issues.apache.org/jira/browse/AMQ-3049
- reconnectDelay of -1 not appropriate for sleep

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java?rev=1044340&r1=1044339&r2=1044340&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java
Fri Dec 10 13:07:00 2010
@@ -70,7 +70,7 @@ import org.apache.commons.logging.LogFac
 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 implement
     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 implement
     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 implement
                 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) {



Mime
View raw message