gemmellr commented on code in PR #4485:
URL: https://github.com/apache/activemq-artemis/pull/4485#discussion_r1202778227


##########
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:
   Its worked that way for as long as I've used SLF4J really. 
https://www.slf4j.org/faq.html#paramException
   
   I'd agree the javadoc isnt clear on this, which I'd never noticed as...I 
knew it worked that way and so have never really needed to look :)



-- 
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]

Reply via email to