Author: ataylor
Date: 2010-11-03 11:32:04 -0400 (Wed, 03 Nov 2010)
New Revision: 9837
Modified:
branches/2_2_0_HA_Improvements/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/util/SameProcessHornetQServer.java
Log:
get backup config before we call node down
Modified:
branches/2_2_0_HA_Improvements/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
===================================================================
---
branches/2_2_0_HA_Improvements/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java 2010-11-03
13:02:01 UTC (rev 9836)
+++
branches/2_2_0_HA_Improvements/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java 2010-11-03
15:32:04 UTC (rev 9837)
@@ -26,10 +26,7 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Lock;
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.HornetQException;
-import org.hornetq.api.core.Interceptor;
-import org.hornetq.api.core.TransportConfiguration;
+import org.hornetq.api.core.*;
import org.hornetq.api.core.client.ClientSession;
import org.hornetq.api.core.client.ServerLocator;
import org.hornetq.api.core.client.SessionFailureListener;
@@ -88,6 +85,8 @@
private TransportConfiguration connectorConfig;
+ private TransportConfiguration backupConfig;
+
private ConnectorFactory connectorFactory;
private Map<String, Object> transportParams;
@@ -514,8 +513,6 @@
// We will try to failover if there is a backup connector factory, but we
don't do this if the server
// has been shutdown cleanly unless failoverOnServerShutdown is true
- TransportConfiguration backupConfig = serverLocator.getBackup(connectorConfig);
-
boolean attemptFailover = (backupConfig != null) && !serverShutdown;
boolean attemptReconnect;
@@ -592,6 +589,8 @@
// Now try failing over to backup
this.connectorConfig = backupConfig;
+
+ backupConfig = null;
connectorFactory =
instantiateConnectorFactory(connectorConfig.getFactoryClassName());
@@ -1205,8 +1204,10 @@
// cause reconnect loop
public void run()
{
- if (msg.getNodeID() != null)
+ SimpleString nodeID = msg.getNodeID();
+ if (nodeID != null)
{
+ backupConfig = serverLocator.getBackup(connectorConfig);
serverLocator.notifyNodeDown(msg.getNodeID().toString());
}
Modified:
branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/util/SameProcessHornetQServer.java
===================================================================
---
branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/util/SameProcessHornetQServer.java 2010-11-03
13:02:01 UTC (rev 9836)
+++
branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/util/SameProcessHornetQServer.java 2010-11-03
15:32:04 UTC (rev 9837)
@@ -88,12 +88,12 @@
{
session.addFailureListener(new MyListener());
}
- Set<RemotingConnection> connections =
server.getRemotingService().getConnections();
+ /*Set<RemotingConnection> connections =
server.getRemotingService().getConnections();
for (RemotingConnection remotingConnection : connections)
{
remotingConnection.destroy();
server.getRemotingService().removeConnection(remotingConnection.getID());
- }
+ }*/
ClusterManagerImpl clusterManager = (ClusterManagerImpl)
server.getClusterManager();
clusterManager.clear();
Show replies by date