davsclaus commented on code in PR #27523:
URL: https://github.com/apache/camel/pull/27523#discussion_r4215823492


##########
core/camel-support/src/main/java/org/apache/camel/support/cache/ServicePool.java:
##########
@@ -211,7 +213,7 @@ private static boolean isEndpointInUse(Endpoint endpoint) {
                 return true;
             }
         }
-        return false;
+        return context.hasService(s -> s instanceof EndpointAware ea && 
ea.getEndpoint() == endpoint) != null;

Review Comment:
   Optional: this treats any `EndpointAware` service registered on the context 
as a user of the endpoint, not only producers/consumers pooled by a 
`ServicePool`. That errs on the safe side (the endpoint stays started), which I 
think is the right default; a short note in the javadoc above that this is 
intentionally broad would help the next reader.



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