You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2026/05/19 19:54:32 UTC
(camel) 01/01: camel-core - Fix endpoint utilization statistics double-counting input hits
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch fix-endpoint-utilization-stats-double-counting
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 3ed4fb44bd53228cf66a13572c71b46c93d94a08
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue May 19 21:54:14 2026 +0200
camel-core - Fix endpoint utilization statistics double-counting input hits
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 <no...@anthropic.com>
---
.../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);