jbertram commented on code in PR #4485:
URL: https://github.com/apache/activemq-artemis/pull/4485#discussion_r1202732696
##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/federation/FederatedQueueConsumerImpl.java:
##########
@@ -95,24 +103,31 @@ public int decrementCount() {
}
@Override
- public void start() {
- scheduleConnect(0);
+ public synchronized void start() {
+ if (!started) {
+ started = true;
+ scheduleConnect(0);
+ }
}
private void scheduleConnect(int delay) {
- scheduledExecutorService.schedule(() -> {
+ currentConnectTask = scheduledExecutorService.schedule(() -> {
try {
connect();
} catch (Exception e) {
- scheduleConnect(FederatedQueueConsumer.getNextDelay(delay,
intialConnectDelayMultiplier, intialConnectDelayMax));
+ int nextDelay = FederatedQueueConsumer.getNextDelay(delay,
intialConnectDelayMultiplier, intialConnectDelayMax);
+ if (logger.isTraceEnabled()) {
+ logger.trace(this + " failed to connect. Scheduling reconnect
in " + nextDelay + " seconds.", e);
Review Comment:
The problem with using place-holders is that there's no method which takes
place-holders which also takes the cause and will log the whole stack-trace.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]