camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject camel git commit: CAMEL-10856: ZipkinTracer does not trigger doStart() when used in XML DSL
Date Mon, 20 Feb 2017 09:31:04 GMT
Repository: camel
Updated Branches:
  refs/heads/camel-2.18.x b803b2190 -> 996bad36b


CAMEL-10856: ZipkinTracer does not trigger doStart() when used in XML DSL


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

Branch: refs/heads/camel-2.18.x
Commit: 996bad36b99899df9515f6ad8ced4b4d0c940f38
Parents: b803b21
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Mon Feb 20 10:30:13 2017 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Mon Feb 20 10:31:00 2017 +0100

----------------------------------------------------------------------
 .../src/main/java/org/apache/camel/zipkin/ZipkinTracer.java    | 5 +++--
 .../org/apache/camel/zipkin/SpringZipkinSimpleRouteTest.java   | 2 +-
 .../org/apache/camel/zipkin/SpringZipkinSimpleRouteTest.xml    | 6 ++++++
 3 files changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/996bad36/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinTracer.java
----------------------------------------------------------------------
diff --git a/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinTracer.java
b/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinTracer.java
index 68d097b..fc6fb7e 100644
--- a/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinTracer.java
+++ b/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinTracer.java
@@ -115,14 +115,15 @@ public class ZipkinTracer extends ServiceSupport implements RoutePolicyFactory,
     public ZipkinTracer() {
     }
 
-
     @Override
     public RoutePolicy createRoutePolicy(CamelContext camelContext, String routeId, RouteDefinition
route) {
+        // ensure this zipkin tracer gets initialized when Camel starts
+        init(camelContext);
         return new ZipkinRoutePolicy(routeId);
     }
 
     /**
-     * Registers this {@link ZipkinTracer} on the {@link CamelContext}.
+     * Registers this {@link ZipkinTracer} on the {@link CamelContext} if not already registered.
      */
     public void init(CamelContext camelContext) {
         if (!camelContext.hasService(this)) {

http://git-wip-us.apache.org/repos/asf/camel/blob/996bad36/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/SpringZipkinSimpleRouteTest.java
----------------------------------------------------------------------
diff --git a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/SpringZipkinSimpleRouteTest.java
b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/SpringZipkinSimpleRouteTest.java
index 9219bcb..0c68f81 100644
--- a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/SpringZipkinSimpleRouteTest.java
+++ b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/SpringZipkinSimpleRouteTest.java
@@ -36,7 +36,7 @@ public class SpringZipkinSimpleRouteTest extends CamelSpringTestSupport
{
         NotifyBuilder notify = new NotifyBuilder(context).whenDone(5).create();
 
         for (int i = 0; i < 5; i++) {
-            template.sendBody("seda:dude", "Hello World");
+            template.sendBody("direct:start", "Hello World");
         }
 
         assertTrue(notify.matches(30, TimeUnit.SECONDS));

http://git-wip-us.apache.org/repos/asf/camel/blob/996bad36/components/camel-zipkin/src/test/resources/org/apache/camel/zipkin/SpringZipkinSimpleRouteTest.xml
----------------------------------------------------------------------
diff --git a/components/camel-zipkin/src/test/resources/org/apache/camel/zipkin/SpringZipkinSimpleRouteTest.xml
b/components/camel-zipkin/src/test/resources/org/apache/camel/zipkin/SpringZipkinSimpleRouteTest.xml
index 089d98a..b47f0ba 100644
--- a/components/camel-zipkin/src/test/resources/org/apache/camel/zipkin/SpringZipkinSimpleRouteTest.xml
+++ b/components/camel-zipkin/src/test/resources/org/apache/camel/zipkin/SpringZipkinSimpleRouteTest.xml
@@ -32,6 +32,12 @@
   </bean>
 
   <camelContext xmlns="http://camel.apache.org/schema/spring">
+
+    <route id="start">
+      <from uri="direct:start"/>
+      <to uri="seda:dude"/>
+    </route>
+
     <route id="dude">
       <from uri="seda:dude"/>
       <log message="Routing at ${routeId}"/>


Mime
View raw message