atiaomar1978-hub commented on code in PR #25558:
URL: https://github.com/apache/camel/pull/25558#discussion_r3868290733


##########
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:
   Fixed — `onShutdownEndpoint()` now uses `ref.hasConsumers()` and 
`ref.hasProducers()` before removing the shared queue entry from the component 
map.



##########
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:
   Fixed — updated to "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:
   Fixed — same grammar correction in `shutdown()`.



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