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


##########
core/camel-management/src/main/java/org/apache/camel/management/mbean/ManagedPerformanceCounter.java:
##########
@@ -315,14 +320,21 @@ public void processExchange(Exchange exchange, String 
type) {
 
     @Override
     public void completedExchange(Exchange exchange, long time) {
+        exchangesInflight.decrement();
+        if (!statisticsEnabled) {
+            return;
+        }
         increment();
         exchangesCompleted.increment();
-        exchangesInflight.decrement();
 
         if (ExchangeHelper.isFailureHandled(exchange)) {
             failuresHandled.increment();
             
lastExchangeFailureHandledTimestamp.updateValue(System.currentTimeMillis());
         }
+        // a redelivery attempt that succeeds is also a redelivery
+        if (ExchangeHelper.isRedelivered(exchange)) {

Review Comment:
   Thanks, confirmed and fixed in e4e19c1241a1. A processor now records on the 
exchange (internal properties with its route and processor id) that its attempt 
failed, and a redelivery is only counted when the exchange is redelivered and 
the last failure was at that processor. A route only counts it when the failed 
processor is in that route, and the CamelContext counts a redelivered exchange 
once. With your example: flaky-processor 2, route flaky 1, and after-flaky / 
call-other / in-other / route other all 0. That's now asserted in 
`ManagedRedeliverTest.testRedeliverSucceeds`. This also fixes the older 
failed-path over-count for a later step that fails. The upgrade guide now says 
what each level counts.
   
   _Claude Code on behalf of davsclaus_



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