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 2017/12/21 10:39:09 UTC

[camel] branch master updated: CAMEL-12098: URISyntaxException in OpenTracingTracer for endpoints with path parameters

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

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


The following commit(s) were added to refs/heads/master by this push:
     new f56c828  CAMEL-12098: URISyntaxException in OpenTracingTracer for endpoints with path parameters
f56c828 is described below

commit f56c82812e716acf1ac9b6d6f314f7026b419648
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Dec 21 11:38:02 2017 +0100

    CAMEL-12098: URISyntaxException in OpenTracingTracer for endpoints with path parameters
---
 .../org/apache/camel/opentracing/OpenTracingTracer.java     | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/components/camel-opentracing/src/main/java/org/apache/camel/opentracing/OpenTracingTracer.java b/components/camel-opentracing/src/main/java/org/apache/camel/opentracing/OpenTracingTracer.java
index 561c9f9..c3395c9 100644
--- a/components/camel-opentracing/src/main/java/org/apache/camel/opentracing/OpenTracingTracer.java
+++ b/components/camel-opentracing/src/main/java/org/apache/camel/opentracing/OpenTracingTracer.java
@@ -16,7 +16,6 @@
  */
 package org.apache.camel.opentracing;
 
-import java.net.URI;
 import java.util.EventObject;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -53,6 +52,7 @@ import org.apache.camel.util.CamelLogger;
 import org.apache.camel.util.EndpointHelper;
 import org.apache.camel.util.ObjectHelper;
 import org.apache.camel.util.ServiceHelper;
+import org.apache.camel.util.StringHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -189,10 +189,15 @@ public class OpenTracingTracer extends ServiceSupport implements RoutePolicyFact
     }
 
     protected SpanDecorator getSpanDecorator(Endpoint endpoint) {
-        SpanDecorator sd = decorators.get(URI.create(endpoint.getEndpointUri()).getScheme());
-        if (sd == null) {
-            return SpanDecorator.DEFAULT;
+        SpanDecorator sd = SpanDecorator.DEFAULT;
+
+        String uri = endpoint.getEndpointUri();
+        String splitURI[] = StringHelper.splitOnCharacter(uri, ":", 2);
+        if (splitURI[1] != null) {
+            String scheme = splitURI[0];
+            sd = decorators.getOrDefault(scheme, sd);
         }
+
         return sd;
     }
 

-- 
To stop receiving notification emails like this one, please contact
['"commits@camel.apache.org" <co...@camel.apache.org>'].