orpiske commented on code in PR #13273:
URL: https://github.com/apache/camel/pull/13273#discussion_r1500404647


##########
core/camel-main/src/main/java/org/apache/camel/main/MainDurationEventNotifier.java:
##########
@@ -110,10 +121,19 @@ protected void doNotify(CamelEvent event) {
             if (complete) {
                 doneMessages.increment();
                 final int doneCount = doneMessages.intValue();
-                final boolean result = doneCount >= maxMessages;
+                final int inflight = 
camelContext.getInflightRepository().size();
+
+                boolean result = doneCount >= maxMessages;
+                if (result && !maxMessagesIgnoreInflightExchanges) {
+                    result = inflight == 0;
+                }
 
                 if (LOG.isTraceEnabled()) {
-                    LOG.trace("Duration max messages check {} >= {} -> {}", 
doneCount, maxMessages, result);
+                    if (!maxMessagesIgnoreInflightExchanges) {
+                        LOG.trace("Duration max messages check {}/{} >= {} -> 
{}", doneCount, inflight, maxMessages, result);
+                    } else {
+                        LOG.trace("Duration max messages check {} >= {} -> 
{}", doneCount, maxMessages, result);
+                    }

Review Comment:
   I think that would do the trick



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