allthingssecurity commented on code in PR #26797:
URL: https://github.com/apache/camel/pull/26797#discussion_r4093619790


##########
components/camel-seda/src/main/java/org/apache/camel/component/seda/SedaConsumer.java:
##########
@@ -91,6 +91,11 @@ public int getPendingExchangesSize() {
         if (getEndpoint().isPurgeWhenStopping()) {
             getEndpoint().purgeQueue();
         }
+        if (isSuspending() || isSuspended()) {
+            // a suspended consumer does not poll the queue, so do not wait 
for it to complete the pending exchanges
+            // (they are kept on the queue)
+            return 0;
+        }
         return getEndpoint().getQueue().size();

Review Comment:
   Good point, done in dbfc9fa8e. `getPendingExchangesSize()` now has a javadoc 
saying it isn't only a getter: it purges the queue first when 
`purgeWhenStopping` is enabled, and it returns 0 for a suspending/suspended 
consumer, because that consumer doesn't poll the queue (the pending exchanges 
stay on the queue unless purged).
   
   _Claude Code on behalf of allthingssecurity_



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