camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acosent...@apache.org
Subject camel git commit: CAMEL-11258 Use TracerResolver to locate Tracer without modifying code/config
Date Thu, 11 May 2017 09:16:31 GMT
Repository: camel
Updated Branches:
  refs/heads/camel-2.19.x 90e2c6a8b -> 103b09d1d


CAMEL-11258 Use TracerResolver to locate Tracer without modifying code/config


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/103b09d1
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/103b09d1
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/103b09d1

Branch: refs/heads/camel-2.19.x
Commit: 103b09d1dda7c76b4509b07e10b7b71aeac361ae
Parents: 90e2c6a
Author: Gary Brown <gary@brownuk.com>
Authored: Wed May 10 16:48:57 2017 +0100
Committer: Andrea Cosentino <ancosen@gmail.com>
Committed: Thu May 11 11:01:48 2017 +0200

----------------------------------------------------------------------
 components/camel-opentracing/pom.xml                     |  5 +++++
 .../org/apache/camel/opentracing/OpenTracingTracer.java  | 11 ++---------
 parent/pom.xml                                           |  3 ++-
 3 files changed, 9 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/103b09d1/components/camel-opentracing/pom.xml
----------------------------------------------------------------------
diff --git a/components/camel-opentracing/pom.xml b/components/camel-opentracing/pom.xml
index 8152a0b..9b515d2 100644
--- a/components/camel-opentracing/pom.xml
+++ b/components/camel-opentracing/pom.xml
@@ -59,6 +59,11 @@
       <artifactId>opentracing-noop</artifactId>
       <version>${opentracing-version}</version>
     </dependency>
+    <dependency>
+      <groupId>io.opentracing.contrib</groupId>
+      <artifactId>opentracing-tracerresolver</artifactId>
+      <version>${opentracing-tracerresolver-version}</version>
+    </dependency>
 
     <!-- test dependencies -->
     <dependency>

http://git-wip-us.apache.org/repos/asf/camel/blob/103b09d1/components/camel-opentracing/src/main/java/org/apache/camel/opentracing/OpenTracingTracer.java
----------------------------------------------------------------------
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 0a03044..2cafa59 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
@@ -19,7 +19,6 @@ package org.apache.camel.opentracing;
 import java.net.URI;
 import java.util.EventObject;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.Map;
 import java.util.ServiceLoader;
 import java.util.Set;
@@ -28,6 +27,7 @@ import io.opentracing.NoopTracerFactory;
 import io.opentracing.Span;
 import io.opentracing.Tracer;
 import io.opentracing.Tracer.SpanBuilder;
+import io.opentracing.contrib.tracerresolver.TracerResolver;
 import io.opentracing.propagation.Format;
 import io.opentracing.tag.Tags;
 import org.apache.camel.CamelContext;
@@ -147,14 +147,7 @@ public class OpenTracingTracer extends ServiceSupport implements RoutePolicyFact
         }
 
         if (tracer == null) {
-            // Attempt to load tracer using ServiceLoader
-            Iterator<Tracer> iter = ServiceLoader.load(Tracer.class).iterator();
-            if (iter.hasNext()) {
-                tracer = iter.next();
-                if (iter.hasNext()) {
-                    LOG.warn("Multiple Tracer implementations available - selected: " + tracer);
-                }
-            }
+            tracer = TracerResolver.resolveTracer();
         }
 
         if (tracer == null) {

http://git-wip-us.apache.org/repos/asf/camel/blob/103b09d1/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index 8354e39..f9f7fe8 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -499,8 +499,9 @@
     <openshift-java-client-version>2.7.0.Final</openshift-java-client-version>
     <openstack4j-version>3.0.2</openstack4j-version>
     <openstack4j-guava-version>17.0</openstack4j-guava-version>
-    <opentracing-java-agent-version>0.0.11</opentracing-java-agent-version>
+    <opentracing-java-agent-version>0.0.12</opentracing-java-agent-version>
     <opentracing-version>0.21.0</opentracing-version>
+    <opentracing-tracerresolver-version>0.1.0</opentracing-tracerresolver-version>
     <ops4j-base-version>1.5.0</ops4j-base-version>
     <optaplanner-version>6.5.0.Final</optaplanner-version>
     <oro-bundle-version>2.0.8_6</oro-bundle-version>


Mime
View raw message