You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ar...@apache.org on 2009/03/04 15:35:27 UTC

svn commit: r750025 - /qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/jms/failover/FailoverRoundRobinServers.java

Author: arnaudsimon
Date: Wed Mar  4 14:35:26 2009
New Revision: 750025

URL: http://svn.apache.org/viewvc?rev=750025&view=rev
Log:
qpid-1712: changed default value for _cycleRetries to 1

Modified:
    qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/jms/failover/FailoverRoundRobinServers.java

Modified: qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/jms/failover/FailoverRoundRobinServers.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/jms/failover/FailoverRoundRobinServers.java?rev=750025&r1=750024&r2=750025&view=diff
==============================================================================
--- qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/jms/failover/FailoverRoundRobinServers.java (original)
+++ qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/jms/failover/FailoverRoundRobinServers.java Wed Mar  4 14:35:26 2009
@@ -30,7 +30,7 @@
     private static final Logger _logger = LoggerFactory.getLogger(FailoverRoundRobinServers.class);
 
     /** The default number of times to cycle through all servers */
-    public static final int DEFAULT_CYCLE_RETRIES = 0;
+    public static final int DEFAULT_CYCLE_RETRIES = 1;
     /** The default number of times to retry each server */
     public static final int DEFAULT_SERVER_RETRIES = 0;
 
@@ -66,6 +66,8 @@
 
         String cycleRetries = _connectionDetails.getFailoverOption(ConnectionURL.OPTIONS_FAILOVER_CYCLE);
 
+        _cycleRetries = DEFAULT_CYCLE_RETRIES;
+        
         if (cycleRetries != null)
         {
             try
@@ -74,7 +76,7 @@
             }
             catch (NumberFormatException nfe)
             {
-                _cycleRetries = DEFAULT_CYCLE_RETRIES;
+                _logger.warn("Cannot set cycle Retries, " + cycleRetries + " is not a number. Using default: " + DEFAULT_CYCLE_RETRIES); 
             }
         }
 
@@ -93,8 +95,8 @@
 
     public boolean failoverAllowed()
     {
-        return ((_currentCycleRetries < _cycleRetries) || (_currentServerRetry < _serverRetries)
-                || (_currentBrokerIndex < (_connectionDetails.getBrokerCount() - 1)));
+        return ((_currentCycleRetries < _cycleRetries) || (_currentServerRetry < _serverRetries));
+                //|| (_currentBrokerIndex <= (_connectionDetails.getBrokerCount() - 1)));
     }
 
     public void attainedConnection()



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org