gnodet-bot commented on code in PR #30308:
URL: https://github.com/apache/camel/pull/30308#discussion_r4610292111


##########
components/camel-scheduler/src/main/java/org/apache/camel/component/scheduler/SchedulerEndpoint.java:
##########
@@ -125,14 +126,28 @@ public void setSynchronous(boolean synchronous) {
     }
 
     public void onConsumerStart(SchedulerConsumer consumer) {
-        // if using default scheduler then obtain thread pool from component 
which manages their lifecycle
-        if (consumer.getScheduler() == null && 
consumer.getScheduledExecutorService() == null) {
+        // if using default scheduler then obtain thread pool from component 
which manages their lifecycle. A consumer
+        // that is started again (stopped and started via JMX or a route 
policy) takes the pool again, as its stop
+        // released it, and the component shut it down if it was the last user
+        boolean usesComponentPool = consumer.getComponentPool() != null;
+        if (usesComponentPool || consumer.getScheduler() == null && 
consumer.getScheduledExecutorService() == null) {

Review Comment:
   🔹 **Nit:** The compound condition would be clearer with explicit parentheses 
to make operator precedence obvious to future readers.
   
   ```suggestion
           if (usesComponentPool || (consumer.getScheduler() == null && 
consumer.getScheduledExecutorService() == null)) {
   ```



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