This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch feat/camel-tui in repository https://gitbox.apache.org/repos/asf/camel.git
commit 51cf146af970c5f0a89015c12494de5077d66fc0 Author: Claus Ibsen <[email protected]> AuthorDate: Mon May 18 13:12:24 2026 +0200 DefaultRuntimeEndpointRegistry: also track consumer endpoint URI in inputs Some components (e.g. rest-openapi) use a logical route endpoint URI that differs from the underlying consumer's actual endpoint URI (e.g. platform-http). ExchangeCreatedEvent records hits under the consumer's URI, but getEndpointStatistics() only looks up URIs registered in the inputs map, which previously only contained the route's logical endpoint URI. Add the consumer's endpoint URI to the inputs set at RouteAddedEvent time when it differs from the route endpoint URI, so that platform-http hit counts are correctly surfaced in the endpoint tab TOTAL column. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> --- .../impl/engine/DefaultRuntimeEndpointRegistry.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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 691992ba4e4b..456013e2d646 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 @@ -218,6 +218,15 @@ public class DefaultRuntimeEndpointRegistry extends EventNotifierSupport impleme // a HashSet is fine for inputs as we only have a limited number of those Set<String> uris = new HashSet<>(); uris.add(endpoint.getEndpointUri()); + // some components (e.g. rest-openapi) delegate to an underlying consumer (e.g. platform-http) whose + // endpoint URI differs from the route's logical endpoint URI; include the consumer's URI so that + // ExchangeCreatedEvent hits recorded under the consumer URI are matched when looking up statistics + if (rse.getRoute().getConsumer() != null) { + String consumerUri = rse.getRoute().getConsumer().getEndpoint().getEndpointUri(); + if (!endpoint.getEndpointUri().equals(consumerUri)) { + uris.add(consumerUri); + } + } inputs.put(routeId, uris); // use a LRUCache for outputs as we could potential have unlimited uris if dynamic routing is in use // and therefore need to have the limit in use @@ -235,6 +244,15 @@ public class DefaultRuntimeEndpointRegistry extends EventNotifierSupport impleme if (key != null) { inputUtilization.remove(key); } + if (rse.getRoute().getConsumer() != null) { + String consumerUri = rse.getRoute().getConsumer().getEndpoint().getEndpointUri(); + if (!uri.equals(consumerUri)) { + String consumerKey = asUtilizationKey(routeId, consumerUri); + if (consumerKey != null) { + inputUtilization.remove(consumerKey); + } + } + } } } else if (extended && event instanceof ExchangeCreatedEvent ece) { // we only capture details in extended mode
