This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new afa8b261a677 camel-core - Fix endpoint utilization statistics 
double-counting input hits (#23338)
afa8b261a677 is described below

commit afa8b261a67720127e09c92d3e48ada1836b0f4e
Author: Claus Ibsen <[email protected]>
AuthorDate: Wed May 20 07:09:19 2026 +0200

    camel-core - Fix endpoint utilization statistics double-counting input hits 
(#23338)
    
    Remove the fallback routeId scan and dynamic inputs addition from the
    ExchangeCreatedEvent handler in DefaultRuntimeEndpointRegistry. This
    workaround was added for rest-openapi exchanges missing fromRouteId,
    but that has since been properly fixed by propagating routeId through
    DefaultPlatformHttpConsumer.setRouteId(). The fallback incorrectly
    matched ProducerTemplate exchanges (which legitimately have null
    fromRouteId) to route inputs, doubling the input hit count.
    
    Co-authored-by: Claude Opus 4.6 <[email protected]>
---
 .../camel/impl/engine/DefaultRuntimeEndpointRegistry.java | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git 
a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultRuntimeEndpointRegistry.java
 
b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultRuntimeEndpointRegistry.java
index 8070612e94a8..88626bbd199a 100644
--- 
a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultRuntimeEndpointRegistry.java
+++ 
b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultRuntimeEndpointRegistry.java
@@ -263,21 +263,6 @@ public class DefaultRuntimeEndpointRegistry extends 
EventNotifierSupport impleme
             if (endpoint != null) {
                 String routeId = ece.getExchange().getFromRouteId();
                 String uri = endpoint.getEndpointUri();
-                // some components (e.g. rest-openapi) delegate to an 
underlying consumer (e.g. platform-http)
-                // whose exchange may not carry a fromRouteId; fall back to 
scanning inputs by URI
-                if (routeId == null) {
-                    for (Map.Entry<String, Set<String>> entry : 
inputs.entrySet()) {
-                        if (entry.getValue().contains(uri)) {
-                            routeId = entry.getKey();
-                            break;
-                        }
-                    }
-                }
-                // ensure the actual consumer URI is in inputs so 
getEndpointStatistics() can find it
-                Set<String> routeInputs = inputs.get(routeId);
-                if (routeInputs != null) {
-                    routeInputs.add(uri);
-                }
                 String key = asUtilizationKey(routeId, uri);
                 if (key != null) {
                     inputUtilization.onHit(key);

Reply via email to