mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-11 06:40:53 +00:00
Fixed consumer channel selection and added better exception logging
This commit is contained in:
1 parent
4539a19cb0
commit
b23ae0defb
2 files changed
+10
-2
No files matched your search
+1
-1
@@ -48,7 +48,7 @@ public class ReplicationMasterDescriptorImpl implements ReplicationMasterDescrip
|
||||
connectionFactory.setPort(port);
|
||||
}
|
||||
Connection connection = connectionFactory.newConnection();
|
||||
Channel channel = connection.createChannel(0);
|
||||
Channel channel = connection.createChannel();
|
||||
channel.exchangeDeclare(exchangeName, "fanout");
|
||||
QueueingConsumer consumer = new QueueingConsumer(channel);
|
||||
String queueName = channel.queueDeclare().getQueue();
|
||||
|
||||
+9
-1
@@ -181,7 +181,15 @@ public class ReplicationServiceImpl implements ReplicationService, OperationExec
|
||||
logger.info("Starting to replicate from "+master);
|
||||
replicatingFromMaster = master;
|
||||
registerReplicaWithMaster(master);
|
||||
QueueingConsumer consumer = master.getConsumer();
|
||||
logger.info("Registered replica with master");
|
||||
QueueingConsumer consumer = null;
|
||||
try {
|
||||
consumer = master.getConsumer();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
throw ex;
|
||||
}
|
||||
logger.info("Connection to exchange successful.");
|
||||
URL initialLoadURL = master.getInitialLoadURL();
|
||||
logger.info("Initial load URL is "+initialLoadURL);
|
||||
final Replicator replicator = new Replicator(master, this, /* startSuspended */ true, consumer);
|
||||
|
||||
Reference in new issue
Block a user