Author: clebert.suconic(a)jboss.com
Date: 2011-06-27 17:00:44 -0400 (Mon, 27 Jun 2011)
New Revision: 10889
Modified:
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java
Log:
Reverting change to what we were supposed to have
Modified:
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java
===================================================================
---
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java 2011-06-27
15:31:15 UTC (rev 10888)
+++
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java 2011-06-27
21:00:44 UTC (rev 10889)
@@ -588,7 +588,6 @@
{
boolean retry;
int attempts = 0;
- int cfAttempts = 0;
do
{
retry = false;
@@ -611,7 +610,7 @@
threadPool,
scheduledThreadPool,
interceptors);
- factory.connect(1, failoverOnInitialConnection);
+ factory.connect(initialConnectAttempts, failoverOnInitialConnection);
}
catch (HornetQException e)
{
@@ -619,21 +618,15 @@
factory = null;
if (e.getCode() == HornetQException.NOT_CONNECTED)
{
- cfAttempts ++;
- if (topologyArray != null && cfAttempts ==
topologyArray.length)
+ attempts++;
+
+ if (topologyArray != null && attempts == topologyArray.length)
{
- attempts++;
- cfAttempts = 0;
- wait(retryInterval);
+ throw new HornetQException(HornetQException.NOT_CONNECTED,
+ "Cannot connect to server(s). Tried
with all available servers.");
}
- if (topologyArray == null && initialConnectors != null
&& cfAttempts == initialConnectors.length)
+ if (topologyArray == null && initialConnectors != null
&& attempts == initialConnectors.length)
{
- attempts++;
- cfAttempts = 0;
- wait(retryInterval);
- }
- if (initialConnectAttempts != -1 && attempts >=
initialConnectAttempts)
- {
throw new HornetQException(HornetQException.NOT_CONNECTED,
"Cannot connect to server(s). Tried
with all available servers.");
}
Show replies by date