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

davsclaus pushed a commit to branch topology-external-endpoints
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 71624bdc5b026daf565d1da3c1fe676d22ea1663
Author: Claus Ibsen <[email protected]>
AuthorDate: Tue Jun 2 11:43:11 2026 +0200

    Fix URI matching for external endpoint metrics
    
    Normalize scheme://path to scheme:path before comparing destination
    URIs from send processors against external endpoint URIs, since
    endpoint URIs may use either format.
    
    Co-Authored-By: Claude Opus 4.6 <[email protected]>
---
 .../apache/camel/impl/console/RouteTopologyDevConsole.java  | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git 
a/core/camel-console/src/main/java/org/apache/camel/impl/console/RouteTopologyDevConsole.java
 
b/core/camel-console/src/main/java/org/apache/camel/impl/console/RouteTopologyDevConsole.java
index f341a78f4312..7c93adeca6fa 100644
--- 
a/core/camel-console/src/main/java/org/apache/camel/impl/console/RouteTopologyDevConsole.java
+++ 
b/core/camel-console/src/main/java/org/apache/camel/impl/console/RouteTopologyDevConsole.java
@@ -169,6 +169,15 @@ public class RouteTopologyDevConsole extends 
AbstractDevConsole {
         return root;
     }
 
+    private static String normalizeScheme(String uri) {
+        // Normalize "scheme://path" to "scheme:path" for consistent matching
+        int idx = uri.indexOf("://");
+        if (idx > 0) {
+            return uri.substring(0, idx) + ":" + uri.substring(idx + 3);
+        }
+        return uri;
+    }
+
     /**
      * Collects per-endpoint metrics for producer endpoints by iterating 
managed send processors. Returns a map keyed by
      * "routeId|normalizedUri" with value [exchangesTotal, exchangesFailed].
@@ -193,8 +202,8 @@ public class RouteTopologyDevConsole extends 
AbstractDevConsole {
                     if (sp == null) {
                         continue;
                     }
-                    String dest = URISupport.stripQuery(sp.getDestination());
-                    if (ep.uri().equals(dest)) {
+                    String dest = 
normalizeScheme(URISupport.stripQuery(sp.getDestination()));
+                    if (normalizeScheme(ep.uri()).equals(dest)) {
                         String key = ep.routeId() + "|" + ep.uri();
                         long[] existing = metrics.get(key);
                         if (existing != null) {

Reply via email to