apupier commented on code in PR #22343:
URL: https://github.com/apache/camel/pull/22343#discussion_r3010558609


##########
components/camel-jcr/src/main/java/org/apache/camel/component/jcr/JcrConsumer.java:
##########
@@ -157,20 +156,23 @@ private void unregisterListenerAndLogoutSession() throws 
RepositoryException {
     }
 
     private void cancelSessionListenerChecker() {
-        if (sessionListenerCheckerScheduledFuture != null) {
-            sessionListenerCheckerScheduledFuture.cancel(true);
+        if (sessionListenerCheckerExecutor != null) {
+            getJcrEndpoint().getCamelContext().getExecutorServiceManager()
+                    .shutdownNow(sessionListenerCheckerExecutor);
+            sessionListenerCheckerExecutor = null;
         }
     }
 
     private void scheduleSessionListenerChecker() {
         String name = "JcrConsumerSessionChecker[" + 
getJcrEndpoint().getEndpointConfiguredDestinationName() + "]";
-        ScheduledExecutorService executor = 
getJcrEndpoint().getCamelContext().getExecutorServiceManager()
+        sessionListenerCheckerExecutor = 
getJcrEndpoint().getCamelContext().getExecutorServiceManager()
                 .newSingleThreadScheduledExecutor(this, name);
         JcrConsumerSessionListenerChecker sessionListenerChecker = new 
JcrConsumerSessionListenerChecker();
         long sessionLiveCheckIntervalOnStart = 
JcrConsumer.this.getJcrEndpoint().getSessionLiveCheckIntervalOnStart();
         long sessionLiveCheckInterval = 
JcrConsumer.this.getJcrEndpoint().getSessionLiveCheckInterval();
-        sessionListenerCheckerScheduledFuture = 
executor.scheduleWithFixedDelay(sessionListenerChecker,
-                sessionLiveCheckIntervalOnStart, sessionLiveCheckInterval, 
TimeUnit.MILLISECONDS);
+        sessionListenerCheckerExecutor.scheduleWithFixedDelay(
+                sessionListenerChecker, sessionLiveCheckIntervalOnStart, 
sessionLiveCheckInterval,
+                TimeUnit.MILLISECONDS);

Review Comment:
   so first I do not understand very well this part of the code.
   
   wonderign if we are not supposed to check if 
`sessionListenerCheckerExecutor` is not already in use, otherwise we will lost 
the reference to it and so cannot cancel or unregister it later on. (butit 
seems there was the same kind of issue before)
   



##########
pom.xml:
##########
@@ -122,6 +122,7 @@
 
         <!-- NOTE: this is required to correctly map each module coverage in 
Sonarqube. The ${maven.multiModuleProjectDirectory} may require some change
             when upgrading to Maven 4.x, according to any of the new variables 
that will replace this one. -->
+        <sonar.java.source>${jdk.version}</sonar.java.source>
         <sonar.coverage.jacoco.xmlReportPaths>
             
${maven.multiModuleProjectDirectory}/coverage/target/site/jacoco-aggregate/jacoco.xml
         </sonar.coverage.jacoco.xmlReportPaths>

Review Comment:
   the comment is only for the sonar.coverage.jacoco.xmlReportPaths , not for 
the sonar.java.source, so I think it will be clearer to keep the comment right 
above the sonar.coverage.jacoco.xmlReportPaths



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