gnodet commented on code in PR #25558:
URL: https://github.com/apache/camel/pull/25558#discussion_r3856865156


##########
components/camel-seda/src/main/java/org/apache/camel/component/seda/QueueReference.java:
##########
@@ -115,4 +118,22 @@ public boolean hasConsumers() {
             lock.unlock();
         }
     }
+
+    /**
+     * Whether any of the endpoints sharing this queue reference still have 
active producers.
+     */
+    public boolean hasProducers() {

Review Comment:
   Minor: `hasProducers()` is defined but never called anywhere in this PR. In 
`SedaComponent.onShutdownEndpoint()`, the check uses 
`endpoint.getProducers().isEmpty()` instead. Consider either removing this 
method or using `ref.hasProducers()` in `onShutdownEndpoint` for a semantically 
broader check across all endpoints sharing this queue reference.



##########
components/camel-seda/src/main/java/org/apache/camel/component/seda/SedaEndpoint.java:
##########
@@ -660,13 +669,12 @@ protected void doStart() throws Exception {
 
     @Override
     public void stop() {
-        if (getConsumers().isEmpty()) {
+        if (getConsumers().isEmpty() && getProducers().isEmpty()) {
             super.stop();
+            ref = null;
         } else {
-            LOG.debug("There is still active consumers.");
+            LOG.debug("There is still active consumers or producers.");

Review Comment:
   Grammar nit: "There is still active consumers or producers" → "There **are** 
still active consumers or producers" (subject-verb agreement). Same on the 
`shutdown()` method below.
   
   ```suggestion
               LOG.debug("There are still active consumers or producers.");
   ```



##########
components/camel-seda/src/main/java/org/apache/camel/component/seda/SedaEndpoint.java:
##########
@@ -681,10 +689,10 @@ public void shutdown() {
             getComponent().onShutdownEndpoint(this);
         }
 
-        if (getConsumers().isEmpty()) {
+        if (getConsumers().isEmpty() && getProducers().isEmpty()) {
             super.shutdown();
         } else {
-            LOG.debug("There is still active consumers.");
+            LOG.debug("There is still active consumers or producers.");

Review Comment:
   Same grammar fix here:
   
   ```suggestion
               LOG.debug("There are still active consumers or producers.");
   ```



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