Skip to content

Commit

Permalink
use correct configuration for HA policy
Browse files Browse the repository at this point in the history
  • Loading branch information
andytaylor committed Jun 4, 2014
1 parent 4f0cb8c commit b93a2f3
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import org.hornetq.core.server.cluster.qourum.QuorumVote;
import org.hornetq.core.server.cluster.qourum.QuorumVoteHandler;
import org.hornetq.core.server.cluster.qourum.Vote;
import org.hornetq.core.server.impl.HornetQServerImpl;
import org.hornetq.spi.core.security.HornetQSecurityManager;

import java.lang.reflect.Array;
Expand Down Expand Up @@ -148,7 +147,7 @@ public synchronized boolean activateSharedStoreBackup(int backupSize, String jou
return false;
}
Configuration configuration = server.getConfiguration().copy();
HornetQServer backup = new HornetQServerImpl(configuration, null, securityManager, server);
HornetQServer backup = server.createBackupServer(configuration);
try
{
int portOffset = haPolicy.getBackupPortOffset() * (backupServers.size() + 1);
Expand Down Expand Up @@ -182,7 +181,7 @@ public synchronized boolean activateReplicatedBackup(int backupSize, SimpleStrin
return false;
}
Configuration configuration = server.getConfiguration().copy();
HornetQServer backup = new HornetQServerImpl(configuration, null, securityManager, server);
HornetQServer backup = server.createBackupServer(configuration);
try
{
TopologyMember member = server.getClusterManager().getDefaultConnection(null).getTopology().getMember(nodeID.toString());
Expand Down Expand Up @@ -307,7 +306,7 @@ private static void updateAcceptorsAndConnectors(Configuration backupConfigurati
{
//we only do this if we are a full server, if scale down then our acceptors wont be needed and our connectors will
// be the same as the parent server
if (backupConfiguration.getBackupStrategy() == BackupStrategy.FULL)
if (backupConfiguration.getHAPolicy().getBackupStrategy() == BackupStrategy.FULL)
{
Set<TransportConfiguration> acceptors = backupConfiguration.getAcceptorConfigurations();
for (TransportConfiguration acceptor : acceptors)
Expand All @@ -324,7 +323,7 @@ private static void updateAcceptorsAndConnectors(Configuration backupConfigurati
}
}
}
else if (backupConfiguration.getBackupStrategy() == BackupStrategy.SCALE_DOWN)
else if (backupConfiguration.getHAPolicy().getBackupStrategy() == BackupStrategy.SCALE_DOWN)
{
//if we are scaling down then we wont need any acceptors but clear anyway for belts and braces
backupConfiguration.getAcceptorConfigurations().clear();
Expand Down

0 comments on commit b93a2f3

Please sign in to comment.