[ 
https://issues.apache.org/jira/browse/ARTEMIS-4286?focusedWorklogId=862200&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-862200
 ]

ASF GitHub Bot logged work on ARTEMIS-4286:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 23/May/23 17:47
            Start Date: 23/May/23 17:47
    Worklog Time Spent: 10m 
      Work Description: 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 :)





Issue Time Tracking
-------------------

    Worklog Id:     (was: 862200)
    Time Spent: 3h 10m  (was: 3h)

> Sometimes federated consumer won't stop
> ---------------------------------------
>
>                 Key: ARTEMIS-4286
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-4286
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>            Reporter: Justin Bertram
>            Assignee: Justin Bertram
>            Priority: Major
>          Time Spent: 3h 10m
>  Remaining Estimate: 0h
>
> If a federated consumer is in the process of connecting when it's closed it 
> won't actually close. It will keep attempting to connect and once it actually 
> connects it will operate as if it was never closed.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to