mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-30 09:26:44 +00:00
true local replication test case that creates a leaderboard which is replicated automatically
This commit is contained in:
+1
-1
@@ -20,7 +20,7 @@ public class Activator implements BundleActivator {
|
||||
MessageBrokerConfiguration brokerConfig = new MessageBrokerConfiguration("SailingServerReplicationBroker",
|
||||
"tcp://localhost:61616", new File(tmpDir, "kahadb").getAbsolutePath());
|
||||
messageBrokerManager = new MessageBrokerManager(brokerConfig);
|
||||
messageBrokerManager.startMessageBroker();
|
||||
messageBrokerManager.startMessageBroker(true);
|
||||
messageBrokerManager.createAndStartConnection();
|
||||
replicationInstancesManager = new ReplicationInstancesManager();
|
||||
ReplicationService serverReplicationMasterService = new ReplicationServiceImpl(replicationInstancesManager, messageBrokerManager);
|
||||
|
||||
+2
-2
@@ -24,13 +24,13 @@ public class MessageBrokerManager {
|
||||
this.configuration = configuration;
|
||||
}
|
||||
|
||||
public void startMessageBroker() throws Exception {
|
||||
public void startMessageBroker(boolean useJmx) throws Exception {
|
||||
broker = new BrokerService();
|
||||
broker.setBrokerName(configuration.getBrokerName());
|
||||
if (configuration.getDataStoreDirectory() != null) {
|
||||
broker.setDataDirectory(configuration.getDataStoreDirectory());
|
||||
}
|
||||
broker.setUseJmx(true);
|
||||
broker.setUseJmx(useJmx);
|
||||
TransportConnector transportConnector = new TransportConnector();
|
||||
transportConnector.setUri(new URI(configuration.getBrokerUrl()));
|
||||
broker.addConnector(transportConnector);
|
||||
|
||||
+7
-3
@@ -174,7 +174,7 @@ public class ReplicationServiceImpl implements ReplicationService, OperationExec
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the UUID that the master generated for this client which is alsy entered into {@link #replicaUUIDs}
|
||||
* @return the UUID that the master generated for this client which is also entered into {@link #replicaUUIDs}
|
||||
*/
|
||||
private String registerReplicaWithMaster(ReplicationMasterDescriptor master) throws IOException, ClassNotFoundException {
|
||||
URL replicationRegistrationRequestURL = master.getReplicationRegistrationRequestURL();
|
||||
@@ -189,7 +189,7 @@ public class ReplicationServiceImpl implements ReplicationService, OperationExec
|
||||
read = content.read(buf);
|
||||
}
|
||||
String replicaUUID = uuid.toString();
|
||||
replicaUUIDs.put(master, replicaUUID);
|
||||
registerReplicaUuidForMaster(replicaUUID, master);
|
||||
return replicaUUID;
|
||||
}
|
||||
|
||||
@@ -201,5 +201,9 @@ public class ReplicationServiceImpl implements ReplicationService, OperationExec
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected void registerReplicaUuidForMaster(String uuid, ReplicationMasterDescriptor master) {
|
||||
replicaUUIDs.put(master, uuid);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user