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 5c50ab7390b CAMEL-20861: Default tracer now include details of when an 
exchange was sent to an endpoint including service location.
5c50ab7390b is described below

commit 5c50ab7390bb1b70481f14aa90a6e23141eb8672
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Tue Jun 11 16:14:47 2024 +0200

    CAMEL-20861: Default tracer now include details of when an exchange was 
sent to an endpoint including service location.
---
 .../java/org/apache/camel/impl/engine/DefaultTracer.java | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git 
a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultTracer.java
 
b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultTracer.java
index 70a44e5ac65..aa23da6ebeb 100644
--- 
a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultTracer.java
+++ 
b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultTracer.java
@@ -134,12 +134,9 @@ public class DefaultTracer extends ServiceSupport 
implements CamelContextAware,
 
             StringJoiner sj = new StringJoiner(", ");
             sj.add("url=" + endpoint.toString());
-            if (endpoint instanceof EndpointServiceLocation esl) {
+            if (endpoint instanceof EndpointServiceLocation esl && 
esl.getServiceUrl() != null) {
                 // enrich with service location
-                String url = esl.getServiceUrl();
-                if (url != null) {
-                    sj.add("service=" + url);
-                }
+                sj.add("service=" + esl.getServiceUrl());
                 String protocol = esl.getServiceProtocol();
                 if (protocol != null) {
                     sj.add("protocol=" + protocol);
@@ -186,14 +183,11 @@ public class DefaultTracer extends ServiceSupport 
implements CamelContextAware,
         // enrich with endpoint service location on incoming request
         if (original) {
             Endpoint endpoint = exchange.getFromEndpoint();
-            if (endpoint instanceof EndpointServiceLocation esl) {
+            if (endpoint instanceof EndpointServiceLocation esl && 
esl.getServiceUrl() != null) {
+                // enrich with service location
                 StringJoiner sj = new StringJoiner(", ");
                 sj.add("url=" + endpoint);
-                // enrich with service location
-                String url = esl.getServiceUrl();
-                if (url != null) {
-                    sj.add("service=" + url);
-                }
+                sj.add("service=" + esl.getServiceUrl());
                 String protocol = esl.getServiceProtocol();
                 if (protocol != null) {
                     sj.add("protocol=" + protocol);

Reply via email to