mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-15 14:56:41 +00:00
bug5213: logging long-lasting connection attempts to RabbitMQ in ReplicationServiceImpl
This commit is contained in:
1 parent
0e1306888b
commit
1d6f743a79
1 file changed
+12
-1
+12
-1
@@ -657,13 +657,24 @@ public class ReplicationServiceImpl implements ReplicationService, OperationsToM
|
||||
QueueingConsumer consumer = null;
|
||||
// logging exception here because it will not propagate
|
||||
// thru the client with all details
|
||||
final Timer timer = new Timer("RabbitMQ Connection Timeout Logger", /* isDaemon */ true);
|
||||
final int LOGGING_TIMEOUT_IN_SECONDS = 10;
|
||||
timer.scheduleAtFixedRate(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
logger.warning("RabbitMQ connection to "+master+
|
||||
" was not obtained in "+LOGGING_TIMEOUT_IN_SECONDS+"s. Keeping trying...");
|
||||
}
|
||||
}, LOGGING_TIMEOUT_IN_SECONDS*1000, LOGGING_TIMEOUT_IN_SECONDS*1000);
|
||||
logger.info("Connecting to message queue " + master);
|
||||
try {
|
||||
logger.info("Connecting to message queue " + master);
|
||||
consumer = master.getConsumer();
|
||||
} catch (Exception ex) {
|
||||
logger.log(Level.SEVERE, "ERROR", ex);
|
||||
replicatingFromMaster = null;
|
||||
throw ex;
|
||||
} finally {
|
||||
timer.cancel();
|
||||
}
|
||||
logger.info("Connection to exchange successful.");
|
||||
final URL initialLoadURL = master.getInitialLoadURL(replicables);
|
||||
|
||||
Reference in new issue
Block a user