You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2017/11/29 14:51:50 UTC

[camel] 03/08: Bumped version from 2.19.2-SNAPSHOT to 2.21.0 as requested in code-review Applied formatting guidlines according to checkstyle

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

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

commit 0ceca02c8d188ea532e6517f072d54f60ba34c6c
Author: Roman Vottner <ro...@gmx.at>
AuthorDate: Tue Oct 31 17:55:55 2017 +0100

    Bumped version from 2.19.2-SNAPSHOT to 2.21.0 as requested in code-review
    Applied formatting guidlines according to checkstyle
---
 components/camel-aws-xray/pom.xml                  |   6 +-
 .../component/aws/xray/EIPTracingStrategy.java     |   2 +-
 .../aws/xray/TraceAnnotatedTracingStrategy.java    |  94 +++---
 .../apache/camel/component/aws/xray/XRayTrace.java |   4 +-
 .../camel/component/aws/xray/XRayTracer.java       |  41 +--
 .../camel/component/aws/xray/ABCRouteTest.java     |  94 +++---
 .../camel/component/aws/xray/BeanTracingTest.java  | 124 +++----
 .../aws/xray/CamelAwsXRayTestSupport.java          |  92 +++---
 .../aws/xray/ClientRecipientListRouteTest.java     |  72 ++--
 .../camel/component/aws/xray/EIPTracingTest.java   | 138 ++++----
 .../component/aws/xray/ErrorHandlingTest.java      | 211 ++++++------
 .../apache/camel/component/aws/xray/ErrorTest.java | 180 +++++-----
 .../camel/component/aws/xray/FakeAWSDaemon.java    | 364 ++++++++++-----------
 .../aws/xray/MulticastParallelRouteTest.java       |  86 ++---
 .../component/aws/xray/MulticastRouteTest.java     |  88 ++---
 .../component/aws/xray/Route2ConcurrentTest.java   |  86 ++---
 .../component/aws/xray/RouteConcurrentTest.java    |  70 ++--
 .../aws/xray/SpringAwsXRaySimpleRouteTest.java     |  36 +-
 .../camel/component/aws/xray/TestDataBuilder.java  | 308 ++++++++---------
 .../apache/camel/component/aws/xray/TestUtils.java | 247 +++++++-------
 .../camel/component/aws/xray/TwoService2Test.java  |  60 ++--
 .../camel/component/aws/xray/TwoServiceTest.java   |  60 ++--
 .../aws/xray/TwoServiceWithExcludeTest.java        |  66 ++--
 .../src/test/resources/logback-test.xml            |   4 +-
 .../camel/aws/xray}/AwsXRaySimpleRouteTest.xml     |   4 +-
 .../camel-aws-xray-starter/pom.xml                 |  61 ++++
 .../src/main/resources/META-INF/LICENSE.txt        | 203 ++++++++++++
 .../src/main/resources/META-INF/NOTICE.txt         |  11 +
 .../src/main/resources/META-INF/spring.provides    |  17 +
 platforms/spring-boot/components-starter/pom.xml   |   1 +
 30 files changed, 1570 insertions(+), 1260 deletions(-)

diff --git a/components/camel-aws-xray/pom.xml b/components/camel-aws-xray/pom.xml
index 9fe4377..b440d7d 100644
--- a/components/camel-aws-xray/pom.xml
+++ b/components/camel-aws-xray/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <artifactId>components</artifactId>
     <groupId>org.apache.camel</groupId>
-    <version>2.19.2-SNAPSHOT</version>
+    <version>2.21.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>camel-aws-xray</artifactId>
@@ -34,11 +34,11 @@
 
   <properties>
     <aws-xray.version>1.2.0</aws-xray.version>
-    <firstVersion>2.19.2</firstVersion>
+    <firstVersion>2.21.0</firstVersion>
     <label>monitoring,microservice</label>
     <title>XRay</title>
 
-    <camel.osgi.export.pkg>org.apache.camel.aws-xray.*</camel.osgi.export.pkg>
+    <camel.osgi.export.pkg>org.apache.camel.component.aws.xray.*</camel.osgi.export.pkg>
   </properties>
 
   <dependencyManagement>
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/EIPTracingStrategy.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/EIPTracingStrategy.java
index c91cdf8..4921e92 100644
--- a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/EIPTracingStrategy.java
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/EIPTracingStrategy.java
@@ -16,9 +16,9 @@
  */
 package org.apache.camel.component.aws.xray;
 
+import java.lang.invoke.MethodHandles;
 import com.amazonaws.xray.AWSXRay;
 import com.amazonaws.xray.entities.Subsegment;
-import java.lang.invoke.MethodHandles;
 import org.apache.camel.CamelContext;
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/TraceAnnotatedTracingStrategy.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/TraceAnnotatedTracingStrategy.java
index a8a7491..8afbd6b 100644
--- a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/TraceAnnotatedTracingStrategy.java
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/TraceAnnotatedTracingStrategy.java
@@ -16,10 +16,10 @@
  */
 package org.apache.camel.component.aws.xray;
 
-import com.amazonaws.xray.AWSXRay;
-import com.amazonaws.xray.entities.Subsegment;
 import java.lang.annotation.Annotation;
 import java.lang.invoke.MethodHandles;
+import com.amazonaws.xray.AWSXRay;
+import com.amazonaws.xray.entities.Subsegment;
 import org.apache.camel.CamelContext;
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
@@ -35,59 +35,59 @@ import org.slf4j.LoggerFactory;
 
 public class TraceAnnotatedTracingStrategy implements InterceptStrategy {
 
-  private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+    private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
-  @Override
-  public Processor wrapProcessorInInterceptors(CamelContext camelContext,
-      ProcessorDefinition<?> processorDefinition,
-      Processor target, Processor nextTarget)
-      throws Exception {
+    @Override
+    public Processor wrapProcessorInInterceptors(CamelContext camelContext,
+        ProcessorDefinition<?> processorDefinition,
+        Processor target, Processor nextTarget)
+        throws Exception {
 
-    Class<?> processorClass = processorDefinition.getClass();
+        Class<?> processorClass = processorDefinition.getClass();
 
-    if (processorDefinition instanceof BeanDefinition) {
-      BeanProcessor beanProcessor = (BeanProcessor) nextTarget;
-      processorClass = beanProcessor.getBean().getClass();
-    } else if (processorDefinition instanceof ProcessDefinition) {
-      DelegateSyncProcessor syncProcessor = (DelegateSyncProcessor) nextTarget;
-      processorClass = syncProcessor.getProcessor().getClass();
-    }
+        if (processorDefinition instanceof BeanDefinition) {
+            BeanProcessor beanProcessor = (BeanProcessor) nextTarget;
+            processorClass = beanProcessor.getBean().getClass();
+        } else if (processorDefinition instanceof ProcessDefinition) {
+            DelegateSyncProcessor syncProcessor = (DelegateSyncProcessor) nextTarget;
+            processorClass = syncProcessor.getProcessor().getClass();
+        }
 
-    if (!processorClass.isAnnotationPresent(XRayTrace.class)) {
-      LOG.trace("{} does not contain an @Trace annotation. Skipping interception",
-          processorClass.getSimpleName());
-      return new DelegateAsyncProcessor(target);
-    }
+        if (!processorClass.isAnnotationPresent(XRayTrace.class)) {
+            LOG.trace("{} does not contain an @Trace annotation. Skipping interception",
+                processorClass.getSimpleName());
+            return new DelegateAsyncProcessor(target);
+        }
 
-    LOG.trace("Wrapping process definition {} of target {} in order for recording its trace",
-        processorDefinition, processorClass);
+        LOG.trace("Wrapping process definition {} of target {} in order for recording its trace",
+            processorDefinition, processorClass);
 
-    Annotation annotation = processorClass.getAnnotation(XRayTrace.class);
-    XRayTrace trace = (XRayTrace)annotation;
+        Annotation annotation = processorClass.getAnnotation(XRayTrace.class);
+        XRayTrace trace = (XRayTrace)annotation;
 
-    String metricName = trace.metricName();
+        String metricName = trace.metricName();
 
-    if ("".equals(metricName)) {
-      metricName = processorClass.getSimpleName();
-    }
+        if ("".equals(metricName)) {
+            metricName = processorClass.getSimpleName();
+        }
 
-    final Class<?> type = processorClass;
-    final String name = metricName;
+        final Class<?> type = processorClass;
+        final String name = metricName;
 
-    return new DelegateAsyncProcessor((Exchange exchange) -> {
-      LOG.trace("Creating new subsegment for {} of type {} - EIP {}", name, type, target);
-      Subsegment subsegment = AWSXRay.beginSubsegment(name);
-      try {
-        LOG.trace("Processing EIP {}", target);
-        target.process(exchange);
-      } catch (Exception ex) {
-        LOG.trace("Handling exception thrown by invoked EIP {}", target);
-        subsegment.addException(ex);
-        throw ex;
-      } finally {
-        LOG.trace("Closing down subsegment for {}", name);
-        subsegment.close();
-      }
-    });
-  }
+        return new DelegateAsyncProcessor((Exchange exchange) -> {
+            LOG.trace("Creating new subsegment for {} of type {} - EIP {}", name, type, target);
+            Subsegment subsegment = AWSXRay.beginSubsegment(name);
+            try {
+                LOG.trace("Processing EIP {}", target);
+                target.process(exchange);
+            } catch (Exception ex) {
+                LOG.trace("Handling exception thrown by invoked EIP {}", target);
+                subsegment.addException(ex);
+                throw ex;
+            } finally {
+                LOG.trace("Closing down subsegment for {}", name);
+                subsegment.close();
+            }
+        });
+    }
 }
\ No newline at end of file
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/XRayTrace.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/XRayTrace.java
index 8a05857..df85ede 100644
--- a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/XRayTrace.java
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/XRayTrace.java
@@ -29,9 +29,9 @@ import java.lang.annotation.Target;
  * The <em>metricName</em> argument allows to define a custom name visible in the resulting AWS XRay
  * trace. If none is defined the simple class name of the respective class will be used.
  */
-@Target({ ElementType.TYPE })
+@Target({ElementType.TYPE})
 @Retention(RetentionPolicy.RUNTIME)
 public @interface XRayTrace {
 
-  String metricName() default "";
+    String metricName() default "";
 }
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/XRayTracer.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/XRayTracer.java
index f213b10..0cedcd6 100644
--- a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/XRayTracer.java
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/XRayTracer.java
@@ -16,14 +16,16 @@
  */
 package org.apache.camel.component.aws.xray;
 
-import com.amazonaws.xray.AWSXRay;
-import com.amazonaws.xray.entities.Segment;
-import com.amazonaws.xray.entities.Subsegment;
-import com.amazonaws.xray.entities.TraceID;
 import java.lang.invoke.MethodHandles;
 import java.util.EventObject;
 import java.util.HashSet;
 import java.util.Set;
+
+import com.amazonaws.xray.AWSXRay;
+import com.amazonaws.xray.entities.Segment;
+import com.amazonaws.xray.entities.Subsegment;
+import com.amazonaws.xray.entities.TraceID;
+
 import org.apache.camel.CamelContext;
 import org.apache.camel.CamelContextAware;
 import org.apache.camel.Exchange;
@@ -62,10 +64,11 @@ import org.slf4j.LoggerFactory;
  */
 public class XRayTracer extends ServiceSupport implements RoutePolicyFactory, StaticService, CamelContextAware {
 
-    private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
-
     /** Header value kept in the message of the exchange **/
     public static final String XRAY_TRACE_ID = "Camel-AWS-XRay-Trace-ID";
+
+    private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
     /** Exchange property for passing a segment between threads **/
     private static final String CURRENT_SEGMENT = "CAMEL_PROPERTY_AWS_XRAY_CURRENT_SEGMENT";
 
@@ -224,15 +227,15 @@ public class XRayTracer extends ServiceSupport implements RoutePolicyFactory, St
             if (event instanceof ExchangeSendingEvent) {
                 ExchangeSendingEvent ese = (ExchangeSendingEvent) event;
                 LOG.trace("-> {} - target: {} (routeId: {})",
-                    event.getClass().getSimpleName(), ese.getEndpoint(),
-                    ese.getExchange().getFromRouteId());
+                        event.getClass().getSimpleName(), ese.getEndpoint(),
+                        ese.getExchange().getFromRouteId());
 
                 if (Thread.currentThread().getName().contains("Multicast")) {
                     // copy the segment from the exchange to the thread (local) context
-                    Segment segment = (Segment)ese.getExchange().getProperty(CURRENT_SEGMENT);
+                    Segment segment = (Segment) ese.getExchange().getProperty(CURRENT_SEGMENT);
                     LOG.trace("Copying over segment {}/{} from exchange received from {} to exchange processing {}",
-                        segment.getId(), segment.getName(), ese.getExchange().getFromEndpoint(),
-                        ese.getEndpoint());
+                            segment.getId(), segment.getName(), ese.getExchange().getFromEndpoint(),
+                            ese.getEndpoint());
                     AWSXRay.setTraceEntity(segment);
                 }
 
@@ -244,7 +247,7 @@ public class XRayTracer extends ServiceSupport implements RoutePolicyFactory, St
                     endpointName = endpointName.replaceAll("\\?", "&");
                     Subsegment subsegment = AWSXRay.beginSubsegment("SendingTo_" + endpointName);
                     LOG.trace("Creating new subsegment with ID {} and name {}",
-                        subsegment.getId(), subsegment.getName());
+                            subsegment.getId(), subsegment.getName());
                 } else {
                     LOG.trace("Ignoring creation of XRay subsegment as no segment exists in the current thread");
                 }
@@ -252,13 +255,13 @@ public class XRayTracer extends ServiceSupport implements RoutePolicyFactory, St
             } else if (event instanceof ExchangeSentEvent) {
                 ExchangeSentEvent ese = (ExchangeSentEvent) event;
                 LOG.trace("-> {} - target: {} (routeId: {})",
-                    event.getClass().getSimpleName(), ese.getEndpoint(), ese.getExchange().getFromRouteId());
+                        event.getClass().getSimpleName(), ese.getEndpoint(), ese.getExchange().getFromRouteId());
 
                 if (AWSXRay.getCurrentSubsegmentOptional().isPresent()) {
                     Subsegment subsegment = AWSXRay.getCurrentSubsegment();
                     subsegment.close();
                     LOG.trace("Closing down subsegment with ID {} and name {}",
-                        subsegment.getId(), subsegment.getName());
+                            subsegment.getId(), subsegment.getName());
                 }
             } else {
                 LOG.trace("Received event {} from source {}", event, event.getSource());
@@ -269,7 +272,7 @@ public class XRayTracer extends ServiceSupport implements RoutePolicyFactory, St
         public boolean isEnabled(EventObject event) {
             // listen for either when an exchange invoked an other endpoint
             return event instanceof ExchangeSendingEvent
-                || event instanceof ExchangeSentEvent;
+                    || event instanceof ExchangeSentEvent;
         }
     }
 
@@ -317,12 +320,12 @@ public class XRayTracer extends ServiceSupport implements RoutePolicyFactory, St
                 Segment segment = AWSXRay.beginSegment(route.getId());
                 segment.setTraceId(traceID);
                 LOG.trace("Created new XRay segment {} with name {}",
-                    segment.getId(), segment.getName());
+                        segment.getId(), segment.getName());
                 exchange.setProperty(CURRENT_SEGMENT, segment);
             } else {
                 Subsegment subsegment = AWSXRay.beginSubsegment(route.getId());
                 LOG.trace("Created new XRay subsegment {} with name {}",
-                    subsegment.getId(), subsegment.getName());
+                        subsegment.getId(), subsegment.getName());
             }
         }
 
@@ -339,12 +342,12 @@ public class XRayTracer extends ServiceSupport implements RoutePolicyFactory, St
                 Subsegment subsegment = AWSXRay.getCurrentSubsegment();
                 subsegment.close();
                 LOG.trace("Closing down Subsegment {} with name {}",
-                    subsegment.getId(), subsegment.getName());
+                        subsegment.getId(), subsegment.getName());
             } else if (AWSXRay.getCurrentSegmentOptional().isPresent()) {
                 Segment segment = AWSXRay.getCurrentSegment();
                 segment.close();
                 LOG.trace("Closing down Segment {} with name {}",
-                    segment.getId(), segment.getName());
+                        segment.getId(), segment.getName());
             }
         }
     }
diff --git a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/ABCRouteTest.java b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/ABCRouteTest.java
index 713a58db..65790c1 100644
--- a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/ABCRouteTest.java
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/ABCRouteTest.java
@@ -21,60 +21,60 @@ import org.junit.Test;
 
 public class ABCRouteTest extends CamelAwsXRayTestSupport {
 
-  public ABCRouteTest() {
-    super(
-        TestDataBuilder.createTrace().inRandomOrder()
-            .withSegment(TestDataBuilder.createSegment("start")
-                .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_direct_a")
-                    .withSubsegment(TestDataBuilder.createSubsegment("a")
-                        .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_seda_b"))
-                        .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_seda_c"))
+    public ABCRouteTest() {
+        super(
+            TestDataBuilder.createTrace().inRandomOrder()
+                .withSegment(TestDataBuilder.createSegment("start")
+                    .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_direct_a")
+                        .withSubsegment(TestDataBuilder.createSubsegment("a")
+                            .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_seda_b"))
+                            .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_seda_c"))
+                        )
                     )
                 )
-            )
-            .withSegment(TestDataBuilder.createSegment("b"))
-            .withSegment(TestDataBuilder.createSegment("c")
-                .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_log_test"))
-            )
-            .withSegment(TestDataBuilder.createSegment("d"))
-    );
-  }
+                .withSegment(TestDataBuilder.createSegment("b"))
+                .withSegment(TestDataBuilder.createSegment("c")
+                    .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_log_test"))
+                )
+                .withSegment(TestDataBuilder.createSegment("d"))
+        );
+    }
 
-  @Test
-  public void testRoute() throws Exception {
-    template.requestBody("direct:start", "Hello");
+    @Test
+    public void testRoute() throws Exception {
+        template.requestBody("direct:start", "Hello");
 
-    verify();
-  }
+        verify();
+    }
 
-  @Override
-  protected RouteBuilder createRouteBuilder() throws Exception {
-    return new RouteBuilder() {
-      @Override
-      public void configure() throws Exception {
-        from("direct:start").routeId("start")
-            .wireTap("seda:d")
-            .to("direct:a");
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                from("direct:start").routeId("start")
+                    .wireTap("seda:d")
+                    .to("direct:a");
 
-        from("direct:a").routeId("a")
-            .log("routing at ${routeId}")
-            .to("seda:b")
-            .delay(2000)
-            .to("seda:c")
-            .log("End of routing");
+                from("direct:a").routeId("a")
+                    .log("routing at ${routeId}")
+                    .to("seda:b")
+                    .delay(2000)
+                    .to("seda:c")
+                    .log("End of routing");
 
-        from("seda:b").routeId("b")
-            .log("routing at ${routeId}")
-            .delay(simple("${random(1000,2000)}"));
+                from("seda:b").routeId("b")
+                    .log("routing at ${routeId}")
+                    .delay(simple("${random(1000,2000)}"));
 
-        from("seda:c").routeId("c")
-            .to("log:test")
-            .delay(simple("${random(0,100)}"));
+                from("seda:c").routeId("c")
+                    .to("log:test")
+                    .delay(simple("${random(0,100)}"));
 
-        from("seda:d").routeId("d")
-            .log("routing at ${routeId}")
-            .delay(simple("${random(10,50)}"));
-      }
-    };
-  }
+                from("seda:d").routeId("d")
+                    .log("routing at ${routeId}")
+                    .delay(simple("${random(10,50)}"));
+            }
+        };
+    }
 }
\ No newline at end of file
diff --git a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/BeanTracingTest.java b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/BeanTracingTest.java
index 943e545..6a136e4 100644
--- a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/BeanTracingTest.java
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/BeanTracingTest.java
@@ -29,79 +29,79 @@ import org.junit.Test;
 
 public class BeanTracingTest extends CamelAwsXRayTestSupport {
 
-  public BeanTracingTest() {
-    super(
-        TestDataBuilder.createTrace()
-            .withSegment(TestDataBuilder.createSegment("start")
-                .withSubsegment(TestDataBuilder.createSubsegment("TraceBean"))
-                .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_seda_otherRoute"))
-                .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_mock_end"))
-                .withAnnotation("body", "HELLO")
-                .withMetadata("originBody", "Hello")
-            )
-            .withSegment(TestDataBuilder.createSegment("otherRoute")
-                .withSubsegment(TestDataBuilder.createSubsegment("processor"))
-            )
-    );
-  }
+    public BeanTracingTest() {
+        super(
+            TestDataBuilder.createTrace()
+                .withSegment(TestDataBuilder.createSegment("start")
+                    .withSubsegment(TestDataBuilder.createSubsegment("TraceBean"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_seda_otherRoute"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_mock_end"))
+                    .withAnnotation("body", "HELLO")
+                    .withMetadata("originBody", "Hello")
+                )
+                .withSegment(TestDataBuilder.createSegment("otherRoute")
+                    .withSubsegment(TestDataBuilder.createSubsegment("processor"))
+                )
+        );
+    }
 
-  @Override
-  protected InterceptStrategy getTracingStrategy() {
-    return new TraceAnnotatedTracingStrategy();
-  }
+    @Override
+    protected InterceptStrategy getTracingStrategy() {
+        return new TraceAnnotatedTracingStrategy();
+    }
 
-  @Test
-  public void testRoute() throws Exception {
-    MockEndpoint mockEndpoint = context.getEndpoint("mock:end", MockEndpoint.class);
-    mockEndpoint.expectedMessageCount(1);
-    mockEndpoint.expectedBodiesReceived("HELLO");
-    mockEndpoint.expectedHeaderReceived("TEST", "done");
+    @Test
+    public void testRoute() throws Exception {
+        MockEndpoint mockEndpoint = context.getEndpoint("mock:end", MockEndpoint.class);
+        mockEndpoint.expectedMessageCount(1);
+        mockEndpoint.expectedBodiesReceived("HELLO");
+        mockEndpoint.expectedHeaderReceived("TEST", "done");
 
-    template.requestBody("direct:start", "Hello");
+        template.requestBody("direct:start", "Hello");
 
-    mockEndpoint.assertIsSatisfied();
+        mockEndpoint.assertIsSatisfied();
 
-    verify();
-  }
+        verify();
+    }
 
-  @Override
-  protected RoutesBuilder createRouteBuilder() throws Exception {
-    return new RouteBuilder() {
-      @Override
-      public void configure() throws Exception {
-        from("direct:start").routeId("start")
-            .log("start has been called")
-            .bean(TraceBean.class)
-            .delay(simple("${random(1000,2000)}"))
-            .to("seda:otherRoute")
-            .to("mock:end");
+    @Override
+    protected RoutesBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                from("direct:start").routeId("start")
+                    .log("start has been called")
+                    .bean(TraceBean.class)
+                    .delay(simple("${random(1000,2000)}"))
+                    .to("seda:otherRoute")
+                    .to("mock:end");
 
-        from("seda:otherRoute").routeId("otherRoute")
-            .log("otherRoute has been called")
-            .process(new CustomProcessor())
-            .delay(simple("${random(0,500)}"));
-      }
-    };
-  }
+                from("seda:otherRoute").routeId("otherRoute")
+                    .log("otherRoute has been called")
+                    .process(new CustomProcessor())
+                    .delay(simple("${random(0,500)}"));
+            }
+        };
+    }
 
-  @XRayTrace
-  public static class TraceBean {
+    @XRayTrace
+    public static class TraceBean {
 
-    @Handler
-    public String convertBocyToUpperCase(@Body String body) {
-      String converted = body.toUpperCase();
-      AWSXRay.getCurrentSegment().putAnnotation("body", converted);
-      AWSXRay.getCurrentSegment().putMetadata("originBody", body);
-      return converted;
+        @Handler
+        public String convertBocyToUpperCase(@Body String body) {
+            String converted = body.toUpperCase();
+            AWSXRay.getCurrentSegment().putAnnotation("body", converted);
+            AWSXRay.getCurrentSegment().putMetadata("originBody", body);
+            return converted;
+        }
     }
-  }
 
-  @XRayTrace(metricName = "processor")
-  public static class CustomProcessor implements Processor {
+    @XRayTrace(metricName = "processor")
+    public static class CustomProcessor implements Processor {
 
-    @Override
-    public void process(Exchange exchange) throws Exception {
-      exchange.getIn().setHeader("TEST", "done");
+        @Override
+        public void process(Exchange exchange) throws Exception {
+            exchange.getIn().setHeader("TEST", "done");
+        }
     }
-  }
 }
\ No newline at end of file
diff --git a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/CamelAwsXRayTestSupport.java b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/CamelAwsXRayTestSupport.java
index 0cafc0a..1f1f203 100644
--- a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/CamelAwsXRayTestSupport.java
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/CamelAwsXRayTestSupport.java
@@ -21,6 +21,7 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+
 import org.apache.camel.CamelContext;
 import org.apache.camel.LoggingLevel;
 import org.apache.camel.component.aws.xray.TestDataBuilder.TestTrace;
@@ -29,65 +30,64 @@ import org.apache.camel.spi.InterceptStrategy;
 import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Rule;
 
-
 public class CamelAwsXRayTestSupport extends CamelTestSupport {
 
-  private List<TestTrace> testData;
+    @Rule
+    public FakeAWSDaemon socketListener = new FakeAWSDaemon();
 
-  @Rule
-  public FakeAWSDaemon socketListener = new FakeAWSDaemon();
+    private List<TestTrace> testData;
 
-  public CamelAwsXRayTestSupport(TestTrace... testData) {
-    this.testData = Arrays.asList(testData);
-  }
+    public CamelAwsXRayTestSupport(TestTrace... testData) {
+        this.testData = Arrays.asList(testData);
+    }
 
-  @Override
-  protected void postProcessTest() throws Exception {
-    super.postProcessTest();
-    socketListener.getReceivedData().clear();
-  }
+    @Override
+    protected void postProcessTest() throws Exception {
+        super.postProcessTest();
+        socketListener.getReceivedData().clear();
+    }
 
-  @Override
-  protected void resetMocks() {
-    super.resetMocks();
-  }
+    @Override
+    protected void resetMocks() {
+        super.resetMocks();
+    }
 
-  @Override
-  protected CamelContext createCamelContext() throws Exception {
-    CamelContext context = super.createCamelContext();
+    @Override
+    protected CamelContext createCamelContext() throws Exception {
+        CamelContext context = super.createCamelContext();
 
-    context.setTracing(true);
-    final Tracer tracer = new Tracer();
-    tracer.getDefaultTraceFormatter().setShowBody(false);
-    tracer.setLogLevel(LoggingLevel.INFO);
-    context.getInterceptStrategies().add(tracer);
+        context.setTracing(true);
+        final Tracer tracer = new Tracer();
+        tracer.getDefaultTraceFormatter().setShowBody(false);
+        tracer.setLogLevel(LoggingLevel.INFO);
+        context.getInterceptStrategies().add(tracer);
 
-    XRayTracer xRayTracer = new XRayTracer();
-    xRayTracer.setCamelContext(context);
-    xRayTracer.setTracingStrategy(getTracingStrategy());
-    xRayTracer.setExcludePatterns(getExcludePatterns());
+        XRayTracer xRayTracer = new XRayTracer();
+        xRayTracer.setCamelContext(context);
+        xRayTracer.setTracingStrategy(getTracingStrategy());
+        xRayTracer.setExcludePatterns(getExcludePatterns());
 
-    xRayTracer.init(context);
+        xRayTracer.init(context);
 
-    return context;
-  }
+        return context;
+    }
 
-  protected InterceptStrategy getTracingStrategy() {
-    return new NoopTracingStrategy();
-  }
+    protected InterceptStrategy getTracingStrategy() {
+        return new NoopTracingStrategy();
+    }
 
-  protected Set<String> getExcludePatterns() {
-    return new HashSet<>();
-  }
+    protected Set<String> getExcludePatterns() {
+        return new HashSet<>();
+    }
 
-  protected void verify() {
-    try {
-      // give the socket listener a bit time to receive the data and transform it to Java objects
-      Thread.sleep(500);
-    } catch (InterruptedException iEx) {
-      // ignore
+    protected void verify() {
+        try {
+            // give the socket listener a bit time to receive the data and transform it to Java objects
+            Thread.sleep(500);
+        } catch (InterruptedException iEx) {
+            // ignore
+        }
+        Map<String, TestTrace> receivedData = socketListener.getReceivedData();
+        TestUtils.checkData(receivedData, testData);
     }
-    Map<String, TestTrace> receivedData = socketListener.getReceivedData();
-    TestUtils.checkData(receivedData, testData);
-  }
 }
\ No newline at end of file
diff --git a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/ClientRecipientListRouteTest.java b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/ClientRecipientListRouteTest.java
index 225602c..ed2b457 100644
--- a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/ClientRecipientListRouteTest.java
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/ClientRecipientListRouteTest.java
@@ -21,46 +21,46 @@ import org.junit.Test;
 
 public class ClientRecipientListRouteTest extends CamelAwsXRayTestSupport {
 
-  public ClientRecipientListRouteTest() {
-    super(
-        TestDataBuilder.createTrace().inRandomOrder()
-            .withSegment(TestDataBuilder.createSegment("start")
-                .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_seda_a"))
-                .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_seda_b"))
-                .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_seda_c"))
-            )
-            .withSegment(TestDataBuilder.createSegment("a"))
-            .withSegment(TestDataBuilder.createSegment("b"))
-            .withSegment(TestDataBuilder.createSegment("c"))
-    );
-  }
+    public ClientRecipientListRouteTest() {
+        super(
+            TestDataBuilder.createTrace().inRandomOrder()
+                .withSegment(TestDataBuilder.createSegment("start")
+                    .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_seda_a"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_seda_b"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_seda_c"))
+                )
+                .withSegment(TestDataBuilder.createSegment("a"))
+                .withSegment(TestDataBuilder.createSegment("b"))
+                .withSegment(TestDataBuilder.createSegment("c"))
+        );
+    }
 
-  @Test
-  public void testRoute() throws Exception {
-    template.requestBody("direct:start", "Hello");
+    @Test
+    public void testRoute() throws Exception {
+        template.requestBody("direct:start", "Hello");
 
-    verify();
-  }
+        verify();
+    }
 
-  @Override
-  protected RouteBuilder createRouteBuilder() throws Exception {
-    return new RouteBuilder() {
-      @Override
-      public void configure() throws Exception {
-        from("direct:start").routeId("start")
-            .recipientList(constant("seda:a,seda:b,seda:c"));
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                from("direct:start").routeId("start")
+                    .recipientList(constant("seda:a,seda:b,seda:c"));
 
-        from("seda:a").routeId("a")
-            .log("routing at ${routeId}");
+                from("seda:a").routeId("a")
+                    .log("routing at ${routeId}");
 
-        from("seda:b").routeId("b")
-            .log("routing at ${routeId}")
-            .delay(simple("${random(1000,2000)}"));
+                from("seda:b").routeId("b")
+                    .log("routing at ${routeId}")
+                    .delay(simple("${random(1000,2000)}"));
 
-        from("seda:c").routeId("c")
-            .log("routing at ${routeId}")
-            .delay(simple("${random(0,100)}"));
-      }
-    };
-  }
+                from("seda:c").routeId("c")
+                    .log("routing at ${routeId}")
+                    .delay(simple("${random(0,100)}"));
+            }
+        };
+    }
 }
\ No newline at end of file
diff --git a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/EIPTracingTest.java b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/EIPTracingTest.java
index 4b6ad69..998a6e4 100644
--- a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/EIPTracingTest.java
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/EIPTracingTest.java
@@ -29,88 +29,88 @@ import org.junit.Test;
 
 public class EIPTracingTest extends CamelAwsXRayTestSupport {
 
-  public EIPTracingTest() {
-    super(
-        TestDataBuilder.createTrace()
-            .withSegment(TestDataBuilder.createSegment("start")
-                .withSubsegment(TestDataBuilder.createSubsegment("log"))
-                .withSubsegment(TestDataBuilder.createSubsegment("bean"))
-                .withSubsegment(TestDataBuilder.createSubsegment("delay")
-                    .withSubsegment(TestDataBuilder.createSubsegment("to")
-                        .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_seda_otherRoute"))
-                    )
-                    .withSubsegment(TestDataBuilder.createSubsegment("to")
-                        .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_mock_end"))
+    public EIPTracingTest() {
+        super(
+            TestDataBuilder.createTrace()
+                .withSegment(TestDataBuilder.createSegment("start")
+                    .withSubsegment(TestDataBuilder.createSubsegment("log"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("bean"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("delay")
+                        .withSubsegment(TestDataBuilder.createSubsegment("to")
+                            .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_seda_otherRoute"))
+                        )
+                        .withSubsegment(TestDataBuilder.createSubsegment("to")
+                            .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_mock_end"))
+                        )
                     )
+                    .withAnnotation("body", "HELLO")
+                    .withMetadata("originBody", "Hello")
+                )
+                .withSegment(TestDataBuilder.createSegment("otherRoute")
+                    .withSubsegment(TestDataBuilder.createSubsegment("log"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("process"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("delay"))
                 )
-                .withAnnotation("body", "HELLO")
-                .withMetadata("originBody", "Hello")
-            )
-            .withSegment(TestDataBuilder.createSegment("otherRoute")
-                .withSubsegment(TestDataBuilder.createSubsegment("log"))
-                .withSubsegment(TestDataBuilder.createSubsegment("process"))
-                .withSubsegment(TestDataBuilder.createSubsegment("delay"))
-            )
-    );
-  }
+        );
+    }
 
-  @Override
-  protected InterceptStrategy getTracingStrategy() {
-    return new EIPTracingStrategy();
-  }
+    @Override
+    protected InterceptStrategy getTracingStrategy() {
+        return new EIPTracingStrategy();
+    }
 
-  @Test
-  public void testRoute() throws Exception {
-    MockEndpoint mockEndpoint = context.getEndpoint("mock:end", MockEndpoint.class);
-    mockEndpoint.expectedMessageCount(1);
-    mockEndpoint.expectedBodiesReceived("HELLO");
-    mockEndpoint.expectedHeaderReceived("TEST", "done");
+    @Test
+    public void testRoute() throws Exception {
+        MockEndpoint mockEndpoint = context.getEndpoint("mock:end", MockEndpoint.class);
+        mockEndpoint.expectedMessageCount(1);
+        mockEndpoint.expectedBodiesReceived("HELLO");
+        mockEndpoint.expectedHeaderReceived("TEST", "done");
 
-    template.requestBody("direct:start", "Hello");
+        template.requestBody("direct:start", "Hello");
 
-    mockEndpoint.assertIsSatisfied();
+        mockEndpoint.assertIsSatisfied();
 
-    verify();
-  }
+        verify();
+    }
 
-  @Override
-  protected RoutesBuilder createRouteBuilder() throws Exception {
-    return new RouteBuilder() {
-      @Override
-      public void configure() throws Exception {
-        from("direct:start").routeId("start")
-            .log("start has been called")
-            .bean(TraceBean.class)
-            .delay(simple("${random(1000,2000)}"))
-            .to("seda:otherRoute")
-            .to("mock:end");
+    @Override
+    protected RoutesBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                from("direct:start").routeId("start")
+                    .log("start has been called")
+                    .bean(TraceBean.class)
+                    .delay(simple("${random(1000,2000)}"))
+                    .to("seda:otherRoute")
+                    .to("mock:end");
 
-        from("seda:otherRoute").routeId("otherRoute")
-            .log("otherRoute has been called")
-            .process(new CustomProcessor())
-            .delay(simple("${random(0,500)}"));
-      }
-    };
-  }
+                from("seda:otherRoute").routeId("otherRoute")
+                    .log("otherRoute has been called")
+                    .process(new CustomProcessor())
+                    .delay(simple("${random(0,500)}"));
+            }
+        };
+    }
 
-  @XRayTrace
-  public static class TraceBean {
+    @XRayTrace
+    public static class TraceBean {
 
-    @Handler
-    public String convertBocyToUpperCase(@Body String body) {
-      String converted = body.toUpperCase();
-      AWSXRay.getCurrentSegment().putAnnotation("body", converted);
-      AWSXRay.getCurrentSegment().putMetadata("originBody", body);
-      return converted;
+        @Handler
+        public String convertBocyToUpperCase(@Body String body) {
+            String converted = body.toUpperCase();
+            AWSXRay.getCurrentSegment().putAnnotation("body", converted);
+            AWSXRay.getCurrentSegment().putMetadata("originBody", body);
+            return converted;
+        }
     }
-  }
 
-  @XRayTrace(metricName = "processor")
-  public static class CustomProcessor implements Processor {
+    @XRayTrace(metricName = "processor")
+    public static class CustomProcessor implements Processor {
 
-    @Override
-    public void process(Exchange exchange) throws Exception {
-      exchange.getIn().setHeader("TEST", "done");
+        @Override
+        public void process(Exchange exchange) throws Exception {
+            exchange.getIn().setHeader("TEST", "done");
+        }
     }
-  }
 }
\ No newline at end of file
diff --git a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/ErrorHandlingTest.java b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/ErrorHandlingTest.java
index dd57dd8..2a1fa1d 100644
--- a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/ErrorHandlingTest.java
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/ErrorHandlingTest.java
@@ -32,125 +32,126 @@ import org.slf4j.LoggerFactory;
 
 public class ErrorHandlingTest extends CamelAwsXRayTestSupport {
 
-  private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+    private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
   // FIXME: check why processors invoked in onRedelivery do not generate a subsegment
-  public ErrorHandlingTest() {
-    super(
-        TestDataBuilder.createTrace()
-            .withSegment(TestDataBuilder.createSegment("start")
-                    .withSubsegment(TestDataBuilder.createSubsegment("TraceBean"))
-//                .withSubsegment(TestDataBuilder.createSubsegment("ExceptionRetryProcessor"))
-                    .withSubsegment(TestDataBuilder.createSubsegment("TraceBean"))
-//                .withSubsegment(TestDataBuilder.createSubsegment("ExceptionRetryProcessor"))
-                    .withSubsegment(TestDataBuilder.createSubsegment("TraceBean"))
-//                .withSubsegment(TestDataBuilder.createSubsegment("ExceptionRetryProcessor"))
-                    .withSubsegment(TestDataBuilder.createSubsegment("TraceBean"))
-                    .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_seda_otherRoute"))
-                    .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_mock_end"))
-            )
-            .withSegment(TestDataBuilder.createSegment("otherRoute"))
-    );
-  }
-
-  @Override
-  protected RoutesBuilder createRouteBuilder() throws Exception {
-    return new RouteBuilder() {
-      @Override
-      public void configure() throws Exception {
-
-        onException(Exception.class)
-            .process(new ExceptionProcessor())
-            .maximumRedeliveries(3)
-            .redeliveryDelay(200)
-            .useExponentialBackOff()
-            .backOffMultiplier(1.5D)
-            .onRedelivery(new ExceptionRetryProcessor())
-            .handled(true)
-            .log(LoggingLevel.WARN, "Caught error while performing task. Reason: ${exception.message} Stacktrace: ${exception.stacktrace}")
-            .end();
-
-        from("direct:start").routeId("start")
-            .log("start has been called")
-            .bean(TraceBean.class)
-            .delay(simple("${random(1000,2000)}"))
-            .to("seda:otherRoute")
-            .to("mock:end");
-
-        from("seda:otherRoute").routeId("otherRoute")
-            .log("otherRoute has been called")
-            .delay(simple("${random(0,500)}"));
-      }
-    };
-  }
-
-  @Override
-  protected InterceptStrategy getTracingStrategy() {
-    return new TraceAnnotatedTracingStrategy();
-  }
-
-  @Test
-  public void testRoute() throws Exception {
-    MockEndpoint mockEndpoint = context.getEndpoint("mock:end", MockEndpoint.class);
-    mockEndpoint.expectedMessageCount(1);
-    mockEndpoint.expectedBodiesReceived("HELLO");
-
-    template.requestBody("direct:start", "Hello");
-
-    mockEndpoint.assertIsSatisfied();
-
-    verify();
-  }
-
-  @XRayTrace
-  public static class TraceBean {
-
-    private static int COUNTER = 0;
-    @Handler
-    public String convertBodyToUpperCase(@Body String body) throws Exception {
-      String converted = body.toUpperCase();
-      if (COUNTER < 3) {
-        COUNTER++;
-        throw new Exception("test");
-      }
-      return converted;
+    public ErrorHandlingTest() {
+        super(
+            TestDataBuilder.createTrace()
+                .withSegment(TestDataBuilder.createSegment("start")
+                        .withSubsegment(TestDataBuilder.createSubsegment("TraceBean"))
+//                      .withSubsegment(TestDataBuilder.createSubsegment("ExceptionRetryProcessor"))
+                        .withSubsegment(TestDataBuilder.createSubsegment("TraceBean"))
+//                      .withSubsegment(TestDataBuilder.createSubsegment("ExceptionRetryProcessor"))
+                        .withSubsegment(TestDataBuilder.createSubsegment("TraceBean"))
+//                      .withSubsegment(TestDataBuilder.createSubsegment("ExceptionRetryProcessor"))
+                        .withSubsegment(TestDataBuilder.createSubsegment("TraceBean"))
+                        .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_seda_otherRoute"))
+                        .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_mock_end"))
+                )
+                .withSegment(TestDataBuilder.createSegment("otherRoute"))
+        );
     }
 
     @Override
-    public String toString() {
-      return "TraceBean";
+    protected RoutesBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+
+                onException(Exception.class)
+                    .process(new ExceptionProcessor())
+                    .maximumRedeliveries(3)
+                    .redeliveryDelay(200)
+                    .useExponentialBackOff()
+                    .backOffMultiplier(1.5D)
+                    .onRedelivery(new ExceptionRetryProcessor())
+                    .handled(true)
+                    .log(LoggingLevel.WARN, "Caught error while performing task. Reason: ${exception.message} Stacktrace: ${exception.stacktrace}")
+                    .end();
+
+                from("direct:start").routeId("start")
+                    .log("start has been called")
+                    .bean(TraceBean.class)
+                    .delay(simple("${random(1000,2000)}"))
+                    .to("seda:otherRoute")
+                    .to("mock:end");
+
+                from("seda:otherRoute").routeId("otherRoute")
+                    .log("otherRoute has been called")
+                    .delay(simple("${random(0,500)}"));
+            }
+        };
     }
-  }
-
-  @XRayTrace
-  public static class ExceptionProcessor implements Processor {
 
     @Override
-    public void process(Exchange exchange) throws Exception {
-      Exception ex = (Exception)exchange.getProperties().get(Exchange.EXCEPTION_CAUGHT);
-      LOG.debug("Processing caught exception {}", ex.getLocalizedMessage());
-      exchange.getIn().getHeaders().put("HandledError",ex.getLocalizedMessage());
+    protected InterceptStrategy getTracingStrategy() {
+        return new TraceAnnotatedTracingStrategy();
     }
 
-    @Override
-    public String toString() {
-      return "ExceptionProcessor";
+    @Test
+    public void testRoute() throws Exception {
+        MockEndpoint mockEndpoint = context.getEndpoint("mock:end", MockEndpoint.class);
+        mockEndpoint.expectedMessageCount(1);
+        mockEndpoint.expectedBodiesReceived("HELLO");
+
+        template.requestBody("direct:start", "Hello");
+
+        mockEndpoint.assertIsSatisfied();
+
+        verify();
+    }
+
+    @XRayTrace
+    public static class TraceBean {
+
+        private static int counter;
+
+        @Handler
+        public String convertBodyToUpperCase(@Body String body) throws Exception {
+            String converted = body.toUpperCase();
+            if (counter < 3) {
+                counter++;
+                throw new Exception("test");
+            }
+            return converted;
+        }
+
+        @Override
+        public String toString() {
+            return "TraceBean";
+        }
     }
-  }
 
-  @XRayTrace
-  public static class ExceptionRetryProcessor implements Processor {
+    @XRayTrace
+    public static class ExceptionProcessor implements Processor {
 
-    @Override
-    public void process(Exchange exchange) throws Exception {
-      Exception ex = (Exception)exchange.getProperties().get(Exchange.EXCEPTION_CAUGHT);
-      LOG.debug(">> Attempting redelivery of handled exception {} with message: {}",
-          ex.getClass().getSimpleName(), ex.getLocalizedMessage());
+        @Override
+        public void process(Exchange exchange) throws Exception {
+            Exception ex = (Exception)exchange.getProperties().get(Exchange.EXCEPTION_CAUGHT);
+            LOG.debug("Processing caught exception {}", ex.getLocalizedMessage());
+            exchange.getIn().getHeaders().put("HandledError", ex.getLocalizedMessage());
+        }
+
+        @Override
+        public String toString() {
+            return "ExceptionProcessor";
+        }
     }
 
-    @Override
-    public String toString() {
-      return "ExceptionRetryProcessor";
+    @XRayTrace
+    public static class ExceptionRetryProcessor implements Processor {
+
+        @Override
+        public void process(Exchange exchange) throws Exception {
+            Exception ex = (Exception)exchange.getProperties().get(Exchange.EXCEPTION_CAUGHT);
+            LOG.debug(">> Attempting redelivery of handled exception {} with message: {}",
+                ex.getClass().getSimpleName(), ex.getLocalizedMessage());
+        }
+
+        @Override
+        public String toString() {
+            return "ExceptionRetryProcessor";
+        }
     }
-  }
 }
\ No newline at end of file
diff --git a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/ErrorTest.java b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/ErrorTest.java
index b7d625d..992c83a 100644
--- a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/ErrorTest.java
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/ErrorTest.java
@@ -31,108 +31,108 @@ import org.slf4j.LoggerFactory;
 
 public class ErrorTest extends CamelAwsXRayTestSupport {
 
-  private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
-
-  // FIXME: check why processors invoked in onRedelivery do not generate a subsegment
-  public ErrorTest() {
-    super(
-        TestDataBuilder.createTrace()
-            .withSegment(TestDataBuilder.createSegment("start")
-                .withSubsegment(TestDataBuilder.createSubsegment("TraceBean"))
-                .withSubsegment(TestDataBuilder.createSubsegment("TraceBean"))
-                .withSubsegment(TestDataBuilder.createSubsegment("TraceBean"))
-                .withSubsegment(TestDataBuilder.createSubsegment("TraceBean"))
-                .withSubsegment(TestDataBuilder.createSubsegment("ExceptionProcessor"))
-            )
-    );
-  }
-
-  @Override
-  protected RoutesBuilder createRouteBuilder() throws Exception {
-    return new RouteBuilder() {
-      @Override
-      public void configure() throws Exception {
-
-        onException(Exception.class)
-            .process(new ExceptionProcessor())
-            .maximumRedeliveries(3)
-            .redeliveryDelay(200)
-            .useExponentialBackOff()
-            .backOffMultiplier(1.5D)
-            .onRedelivery(new ExceptionRetryProcessor())
-            .handled(true)
-            .log(LoggingLevel.WARN, "Caught error while performing task. Reason: ${exception.message} Stacktrace: ${exception.stacktrace}")
-            .end();
-
-        from("direct:start").routeId("start")
-            .log("start has been called")
-            .bean(TraceBean.class)
-            .delay(simple("${random(1000,2000)}"))
-            .to("seda:otherRoute")
-            .to("mock:end");
-
-        from("seda:otherRoute").routeId("otherRoute")
-            .log("otherRoute has been called")
-            .delay(simple("${random(0,500)}"));
-      }
-    };
-  }
-
-  @Override
-  protected InterceptStrategy getTracingStrategy() {
-    return new TraceAnnotatedTracingStrategy();
-  }
-
-  @Test
-  public void testRoute() throws Exception {
-    template.requestBody("direct:start", "Hello");
-
-    verify();
-  }
-
-  @XRayTrace
-  public static class TraceBean {
-
-    @Handler
-    public String convertBodyToUpperCase(@Body String body) throws Exception {
-      throw new Exception("test");
+    private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
+    // FIXME: check why processors invoked in onRedelivery do not generate a subsegment
+    public ErrorTest() {
+        super(
+            TestDataBuilder.createTrace()
+                .withSegment(TestDataBuilder.createSegment("start")
+                    .withSubsegment(TestDataBuilder.createSubsegment("TraceBean"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("TraceBean"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("TraceBean"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("TraceBean"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("ExceptionProcessor"))
+                )
+        );
     }
 
     @Override
-    public String toString() {
-      return "TraceBean";
+    protected RoutesBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+
+                onException(Exception.class)
+                    .process(new ExceptionProcessor())
+                    .maximumRedeliveries(3)
+                    .redeliveryDelay(200)
+                    .useExponentialBackOff()
+                    .backOffMultiplier(1.5D)
+                    .onRedelivery(new ExceptionRetryProcessor())
+                    .handled(true)
+                    .log(LoggingLevel.WARN, "Caught error while performing task. Reason: ${exception.message} Stacktrace: ${exception.stacktrace}")
+                    .end();
+
+                from("direct:start").routeId("start")
+                    .log("start has been called")
+                    .bean(TraceBean.class)
+                    .delay(simple("${random(1000,2000)}"))
+                    .to("seda:otherRoute")
+                    .to("mock:end");
+
+                from("seda:otherRoute").routeId("otherRoute")
+                    .log("otherRoute has been called")
+                    .delay(simple("${random(0,500)}"));
+            }
+        };
     }
-  }
-
-  @XRayTrace
-  public static class ExceptionProcessor implements Processor {
 
     @Override
-    public void process(Exchange exchange) throws Exception {
-      Exception ex = (Exception)exchange.getProperties().get(Exchange.EXCEPTION_CAUGHT);
-      LOG.debug("Processing caught exception {}", ex.getLocalizedMessage());
-      exchange.getIn().getHeaders().put("HandledError",ex.getLocalizedMessage());
+    protected InterceptStrategy getTracingStrategy() {
+        return new TraceAnnotatedTracingStrategy();
     }
 
-    @Override
-    public String toString() {
-      return "ExceptionProcessor";
+    @Test
+    public void testRoute() throws Exception {
+        template.requestBody("direct:start", "Hello");
+
+        verify();
     }
-  }
 
-  @XRayTrace
-  public static class ExceptionRetryProcessor implements Processor {
+    @XRayTrace
+    public static class TraceBean {
 
-    @Override
-    public void process(Exchange exchange) throws Exception {
-      Exception ex = (Exception)exchange.getProperties().get(Exchange.EXCEPTION_CAUGHT);
-      LOG.debug(">> Attempting redelivery of handled exception {} with message: {}",
-          ex.getClass().getSimpleName(), ex.getLocalizedMessage());
+        @Handler
+        public String convertBodyToUpperCase(@Body String body) throws Exception {
+            throw new Exception("test");
+        }
+
+        @Override
+        public String toString() {
+            return "TraceBean";
+        }
     }
 
-    @Override
-    public String toString() {
-      return "ExceptionRetryProcessor";
+    @XRayTrace
+    public static class ExceptionProcessor implements Processor {
+
+        @Override
+        public void process(Exchange exchange) throws Exception {
+            Exception ex = (Exception)exchange.getProperties().get(Exchange.EXCEPTION_CAUGHT);
+            LOG.debug("Processing caught exception {}", ex.getLocalizedMessage());
+            exchange.getIn().getHeaders().put("HandledError", ex.getLocalizedMessage());
+        }
+
+        @Override
+        public String toString() {
+            return "ExceptionProcessor";
+        }
+    }
+
+    @XRayTrace
+    public static class ExceptionRetryProcessor implements Processor {
+
+        @Override
+        public void process(Exchange exchange) throws Exception {
+            Exception ex = (Exception)exchange.getProperties().get(Exchange.EXCEPTION_CAUGHT);
+            LOG.debug(">> Attempting redelivery of handled exception {} with message: {}",
+                ex.getClass().getSimpleName(), ex.getLocalizedMessage());
+        }
+
+        @Override
+        public String toString() {
+            return "ExceptionRetryProcessor";
+        }
     }
-  }
 }
\ No newline at end of file
diff --git a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/FakeAWSDaemon.java b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/FakeAWSDaemon.java
index f94951b..676929d 100644
--- a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/FakeAWSDaemon.java
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/FakeAWSDaemon.java
@@ -41,211 +41,211 @@ import org.slf4j.LoggerFactory;
 
 public class FakeAWSDaemon extends ExternalResource {
 
-  private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
-
-  private Map<String, TestTrace> receivedTraces = Collections.synchronizedMap(new LinkedHashMap<>());
-  private UDPSocketListener socketListener = new UDPSocketListener(receivedTraces);
-  private ExecutorService executorService = Executors.newSingleThreadExecutor();
-
-  @Override
-  protected void before() throws Throwable {
-    LOG.info("Starting up Mock-AWS daemon");
-    executorService.submit(socketListener);
-  }
-
-  @Override
-  protected void after() {
-    LOG.info("Shutting down Mock-AWS daemon");
-    socketListener.close();
-    executorService.shutdown();
-    try {
-      if (!executorService.awaitTermination(10, TimeUnit.SECONDS)) {
-        executorService.shutdownNow();
-        if (!executorService.awaitTermination(10, TimeUnit.SECONDS)) {
-          LOG.error("Could not terminate UDP server");
-        }
-      }
-    } catch (InterruptedException iEx) {
-      executorService.shutdownNow();
-      Thread.currentThread().interrupt();
-    }
-  }
-
-  Map<String, TestTrace> getReceivedData() {
-    LOG.trace("List of received data packages requested: {}", receivedTraces.size());
-    return receivedTraces;
-  }
-
-  private static class UDPSocketListener implements Runnable {
-
     private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
-    private DatagramSocket serverSocket = null;
-    private Map<String, TestTrace> receivedTraces;
-    private volatile boolean done = false;
+    private Map<String, TestTrace> receivedTraces = Collections.synchronizedMap(new LinkedHashMap<>());
+    private UDPSocketListener socketListener = new UDPSocketListener(receivedTraces);
+    private ExecutorService executorService = Executors.newSingleThreadExecutor();
 
-    private UDPSocketListener(Map<String, TestTrace> receivedTraces) {
-      this.receivedTraces = receivedTraces;
+    @Override
+    protected void before() throws Throwable {
+        LOG.info("Starting up Mock-AWS daemon");
+        executorService.submit(socketListener);
     }
 
     @Override
-    public void run() {
-      try {
-        LOG.info("Starting UDP socket listening on port 2000");
-        serverSocket = new DatagramSocket(2000);
-
-        StringBuilder sb = new StringBuilder();
-        byte[] receiveData = new byte[8096];
-        while (!done) {
-          DatagramPacket receivedPacket = new DatagramPacket(receiveData, receiveData.length);
-          serverSocket.receive(receivedPacket);
-
-          LOG.debug("Receiving UDP data");
-          sb.append(new String(receivedPacket.getData()));
-
-          String _segment = null;
-          try {
-            String raw = sb.toString();
-            String[] segments = raw.split("\\n");
-            for (String segment : segments) {
-              _segment = segment;
-              LOG.trace("Processing received segment: {}", segment);
-              if (!"".equals(segment)) {
-                if (segment.contains("format") && segment.contains("version")) {
-                  LOG.trace("Skipping format and version JSON");
-                } else {
-                  LOG.trace("Converting segment {} to a Java object", segment);
-                  JSONObject json = new JSONObject(segment);
-                  String traceId = json.getString("trace_id");
-                  TestTrace testTrace = receivedTraces.get(traceId);
-                  if (null == testTrace) {
-                    testTrace = new TestTrace();
-                  }
-                  testTrace.withSegment(convertData(json));
-                  receivedTraces.put(traceId, testTrace);
+    protected void after() {
+        LOG.info("Shutting down Mock-AWS daemon");
+        socketListener.close();
+        executorService.shutdown();
+        try {
+            if (!executorService.awaitTermination(10, TimeUnit.SECONDS)) {
+                executorService.shutdownNow();
+                if (!executorService.awaitTermination(10, TimeUnit.SECONDS)) {
+                    LOG.error("Could not terminate UDP server");
                 }
-                sb.delete(0, segment.length());
-                if (sb.length() > 1 && sb.charAt(0) == '\n') {
-                  sb.deleteCharAt(0);
-                }
-              }
             }
-            LOG.trace("Item {} received. JSON content: {}, Raw: {}",
-                receivedTraces.size(), receivedTraces, raw);
-          } catch (JSONException jsonEx) {
-            LOG.warn("Could not convert segment " + _segment + " to a Java object", jsonEx);
-          }
+        } catch (InterruptedException iEx) {
+            executorService.shutdownNow();
+            Thread.currentThread().interrupt();
         }
-      } catch (SocketException sex) {
-        LOG.info("UDP socket closed");
-      } catch (Exception ex) {
-        LOG.warn("UDP socket failed due to " + ex.getLocalizedMessage(), ex);
-      }
     }
 
-    private TestSegment convertData(JSONObject json) {
-      String name = json.getString("name");
-      double startTime = json.getDouble("start_time");
-      TestSegment segment = new TestSegment(name, startTime);
-      if (json.has("subsegments")) {
-        JSONArray jsonSubsegments = json.getJSONArray("subsegments");
-        List<TestSubsegment> subsegments = convertSubsegments(jsonSubsegments);
-        for (TestSubsegment subsegment : subsegments) {
-          segment.withSubsegment(subsegment);
-        }
-      }
-      addAnnotationsIfAvailable(segment, json);
-      addMetadataIfAvailable(segment, json);
-      return segment;
+    Map<String, TestTrace> getReceivedData() {
+        LOG.trace("List of received data packages requested: {}", receivedTraces.size());
+        return receivedTraces;
     }
 
-    private List<TestSubsegment> convertSubsegments(JSONArray jsonSubsegments) {
-      List<TestSubsegment> subsegments = new ArrayList<>(jsonSubsegments.length());
-      for (int i = 0; i < jsonSubsegments.length(); i++) {
-        JSONObject jsonSubsegment = jsonSubsegments.getJSONObject(i);
-        subsegments.add(convertSubsegment(jsonSubsegment));
-      }
-      return subsegments;
-    }
+    private static final class UDPSocketListener implements Runnable {
+
+        private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
+        private DatagramSocket serverSocket;
+        private Map<String, TestTrace> receivedTraces;
+        private volatile boolean done;
 
-    private TestSubsegment convertSubsegment(JSONObject json) {
-      TestSubsegment subsegment = new TestSubsegment(json.getString("name"));
-      if (json.has("subsegments")) {
-        List<TestSubsegment> subsegments = convertSubsegments(json.getJSONArray("subsegments"));
-        for (TestSubsegment tss : subsegments) {
-          subsegment.withSubsegment(tss);
+        private UDPSocketListener(Map<String, TestTrace> receivedTraces) {
+            this.receivedTraces = receivedTraces;
         }
-      }
-      addAnnotationsIfAvailable(subsegment, json);
-      addMetadataIfAvailable(subsegment, json);
-      return subsegment;
-    }
 
-    private void addAnnotationsIfAvailable(TestEntity<?> entity, JSONObject json) {
-      if (json.has("annotations")) {
-        Map<String, Object> annotations = parseAnnotations(json.getJSONObject("annotations"));
-        for (String key : annotations.keySet()) {
-          entity.withAnnotation(key, annotations.get(key));
+        @Override
+        public void run() {
+            try {
+                LOG.info("Starting UDP socket listening on port 2000");
+                serverSocket = new DatagramSocket(2000);
+
+                StringBuilder sb = new StringBuilder();
+                byte[] receiveData = new byte[8096];
+                while (!done) {
+                    DatagramPacket receivedPacket = new DatagramPacket(receiveData, receiveData.length);
+                    serverSocket.receive(receivedPacket);
+
+                    LOG.debug("Receiving UDP data");
+                    sb.append(new String(receivedPacket.getData()));
+
+                    String locSegment = null;
+                    try {
+                        String raw = sb.toString();
+                        String[] segments = raw.split("\\n");
+                        for (String segment : segments) {
+                            locSegment = segment;
+                            LOG.trace("Processing received segment: {}", segment);
+                            if (!"".equals(segment)) {
+                                if (segment.contains("format") && segment.contains("version")) {
+                                    LOG.trace("Skipping format and version JSON");
+                                } else {
+                                    LOG.trace("Converting segment {} to a Java object", segment);
+                                    JSONObject json = new JSONObject(segment);
+                                    String traceId = json.getString("trace_id");
+                                    TestTrace testTrace = receivedTraces.get(traceId);
+                                    if (null == testTrace) {
+                                        testTrace = new TestTrace();
+                                    }
+                                    testTrace.withSegment(convertData(json));
+                                    receivedTraces.put(traceId, testTrace);
+                                }
+                                sb.delete(0, segment.length());
+                                if (sb.length() > 1 && sb.charAt(0) == '\n') {
+                                    sb.deleteCharAt(0);
+                                }
+                            }
+                        }
+                        LOG.trace("Item {} received. JSON content: {}, Raw: {}",
+                            receivedTraces.size(), receivedTraces, raw);
+                    } catch (JSONException jsonEx) {
+                        LOG.warn("Could not convert segment " + locSegment + " to a Java object", jsonEx);
+                    }
+                }
+            } catch (SocketException sex) {
+                LOG.info("UDP socket closed");
+            } catch (Exception ex) {
+                LOG.warn("UDP socket failed due to " + ex.getLocalizedMessage(), ex);
+            }
         }
-      }
-    }
 
-    private void addMetadataIfAvailable(TestEntity<?> entity, JSONObject json) {
-      if (json.has("metadata")) {
-        Map<String, Map<String, Object>> metadata = parseMetadata(json.getJSONObject("metadata"));
-        for (String namespace : metadata.keySet()) {
-          for (String key : metadata.get(namespace).keySet()) {
-            entity.withMetadata(namespace, key, metadata.get(namespace).get(key));
-          }
+        private TestSegment convertData(JSONObject json) {
+            String name = json.getString("name");
+            double startTime = json.getDouble("start_time");
+            TestSegment segment = new TestSegment(name, startTime);
+            if (json.has("subsegments")) {
+                JSONArray jsonSubsegments = json.getJSONArray("subsegments");
+                List<TestSubsegment> subsegments = convertSubsegments(jsonSubsegments);
+                for (TestSubsegment subsegment : subsegments) {
+                    segment.withSubsegment(subsegment);
+                }
+            }
+            addAnnotationsIfAvailable(segment, json);
+            addMetadataIfAvailable(segment, json);
+            return segment;
         }
-      }
-    }
 
-    private Map<String, Object> parseAnnotations(JSONObject json) {
-      /*
-       "annotations" : {
-          "test2" : 1,
-          "test3" : true,
-          "test1" : "test"
-       }
-       */
-      Map<String, Object> annotations = new LinkedHashMap<>(json.keySet().size());
-      for (String key : json.keySet()) {
-        annotations.put(key, json.get(key));
-      }
-      return annotations;
-    }
+        private List<TestSubsegment> convertSubsegments(JSONArray jsonSubsegments) {
+            List<TestSubsegment> subsegments = new ArrayList<>(jsonSubsegments.length());
+            for (int i = 0; i < jsonSubsegments.length(); i++) {
+                JSONObject jsonSubsegment = jsonSubsegments.getJSONObject(i);
+                subsegments.add(convertSubsegment(jsonSubsegment));
+            }
+            return subsegments;
+        }
 
-    private Map<String, Map<String, Object>> parseMetadata(JSONObject json) {
-      /*
-       "metadata" : {
-          "default" : {
-              "meta1" : "meta1"
-          },
-          "customNamespace" : {
-              "meta2" : "meta2"
-          }
-       }
-       */
-      Map<String, Map<String, Object>> metadata = new LinkedHashMap<>(json.keySet().size());
-      for (String namespace : json.keySet()) {
-        JSONObject namespaceData = json.getJSONObject(namespace);
-        if (!metadata.containsKey(namespace)) {
-          metadata.put(namespace, new LinkedHashMap<>(namespaceData.keySet().size()));
+        private TestSubsegment convertSubsegment(JSONObject json) {
+            TestSubsegment subsegment = new TestSubsegment(json.getString("name"));
+            if (json.has("subsegments")) {
+                List<TestSubsegment> subsegments = convertSubsegments(json.getJSONArray("subsegments"));
+                for (TestSubsegment tss : subsegments) {
+                    subsegment.withSubsegment(tss);
+                }
+            }
+            addAnnotationsIfAvailable(subsegment, json);
+            addMetadataIfAvailable(subsegment, json);
+            return subsegment;
         }
-        for (String key : namespaceData.keySet()) {
-          metadata.get(namespace).put(key, namespaceData.get(key));
+
+        private void addAnnotationsIfAvailable(TestEntity<?> entity, JSONObject json) {
+            if (json.has("annotations")) {
+                Map<String, Object> annotations = parseAnnotations(json.getJSONObject("annotations"));
+                for (String key : annotations.keySet()) {
+                    entity.withAnnotation(key, annotations.get(key));
+                }
+            }
         }
-      }
-      return metadata;
-    }
 
-    private void close() {
-      done = true;
-      if (null != serverSocket) {
-        LOG.info("Shutting down UDP socket");
-        serverSocket.close();
-      }
+        private void addMetadataIfAvailable(TestEntity<?> entity, JSONObject json) {
+            if (json.has("metadata")) {
+                Map<String, Map<String, Object>> metadata = parseMetadata(json.getJSONObject("metadata"));
+                for (String namespace : metadata.keySet()) {
+                    for (String key : metadata.get(namespace).keySet()) {
+                        entity.withMetadata(namespace, key, metadata.get(namespace).get(key));
+                    }
+                }
+            }
+        }
+
+        private Map<String, Object> parseAnnotations(JSONObject json) {
+            /*
+             "annotations" : {
+                "test2" : 1,
+                "test3" : true,
+                "test1" : "test"
+             }
+             */
+            Map<String, Object> annotations = new LinkedHashMap<>(json.keySet().size());
+            for (String key : json.keySet()) {
+                annotations.put(key, json.get(key));
+            }
+            return annotations;
+        }
+
+        private Map<String, Map<String, Object>> parseMetadata(JSONObject json) {
+            /*
+             "metadata" : {
+                "default" : {
+                    "meta1" : "meta1"
+                },
+                "customNamespace" : {
+                    "meta2" : "meta2"
+                }
+             }
+             */
+            Map<String, Map<String, Object>> metadata = new LinkedHashMap<>(json.keySet().size());
+            for (String namespace : json.keySet()) {
+                JSONObject namespaceData = json.getJSONObject(namespace);
+                if (!metadata.containsKey(namespace)) {
+                    metadata.put(namespace, new LinkedHashMap<>(namespaceData.keySet().size()));
+                }
+                for (String key : namespaceData.keySet()) {
+                    metadata.get(namespace).put(key, namespaceData.get(key));
+                }
+            }
+            return metadata;
+        }
+
+        private void close() {
+            done = true;
+            if (null != serverSocket) {
+                LOG.info("Shutting down UDP socket");
+                serverSocket.close();
+            }
+        }
     }
-  }
 }
\ No newline at end of file
diff --git a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/MulticastParallelRouteTest.java b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/MulticastParallelRouteTest.java
index d0b7e00..257e0bb 100644
--- a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/MulticastParallelRouteTest.java
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/MulticastParallelRouteTest.java
@@ -21,53 +21,53 @@ import org.junit.Test;
 
 public class MulticastParallelRouteTest extends CamelAwsXRayTestSupport {
 
-  public MulticastParallelRouteTest() {
-    super(
-        TestDataBuilder.createTrace().inRandomOrder()
-            .withSegment(TestDataBuilder.createSegment("start")
-                .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_seda_a"))
-            )
-            .withSegment(TestDataBuilder.createSegment("a").inRandomOrder()
-                .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_seda_b"))
-                .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_seda_c"))
-            )
-            .withSegment(TestDataBuilder.createSegment("b"))
-            .withSegment(TestDataBuilder.createSegment("c")
-                .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_log_routing%20at%20$%7BrouteId%7D"))
-            )
-    );
-  }
+    public MulticastParallelRouteTest() {
+        super(
+            TestDataBuilder.createTrace().inRandomOrder()
+                .withSegment(TestDataBuilder.createSegment("start")
+                    .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_seda_a"))
+                )
+                .withSegment(TestDataBuilder.createSegment("a").inRandomOrder()
+                    .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_seda_b"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_seda_c"))
+                )
+                .withSegment(TestDataBuilder.createSegment("b"))
+                .withSegment(TestDataBuilder.createSegment("c")
+                    .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_log_routing%20at%20$%7BrouteId%7D"))
+                )
+        );
+    }
 
-  @Test
-  public void testRoute() throws Exception {
-    template.requestBody("direct:start", "Hello");
+    @Test
+    public void testRoute() throws Exception {
+        template.requestBody("direct:start", "Hello");
 
-    verify();
-  }
+        verify();
+    }
 
-  @Override
-  protected RouteBuilder createRouteBuilder() throws Exception {
-    return new RouteBuilder() {
-      @Override
-      public void configure() throws Exception {
-        from("direct:start").routeId("start")
-            .to("seda:a");
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                from("direct:start").routeId("start")
+                    .to("seda:a");
 
-        from("seda:a").routeId("a")
-            .log("routing at ${routeId}")
-            .multicast().parallelProcessing()
-            .to("seda:b", "seda:c")
-            .end()
-            .log("End of routing");
+                from("seda:a").routeId("a")
+                    .log("routing at ${routeId}")
+                    .multicast().parallelProcessing()
+                    .to("seda:b", "seda:c")
+                    .end()
+                    .log("End of routing");
 
-        from("seda:b").routeId("b")
-            .log("routing at ${routeId}")
-            .delay(simple("${random(1000,2000)}"));
+                from("seda:b").routeId("b")
+                    .log("routing at ${routeId}")
+                    .delay(simple("${random(1000,2000)}"));
 
-        from("seda:c").routeId("c")
-            .to("log:routing at ${routeId}")
-            .delay(simple("${random(0,100)}"));
-      }
-    };
-  }
+                from("seda:c").routeId("c")
+                    .to("log:routing at ${routeId}")
+                    .delay(simple("${random(0,100)}"));
+            }
+        };
+    }
 }
\ No newline at end of file
diff --git a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/MulticastRouteTest.java b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/MulticastRouteTest.java
index e80261f..f981cf8 100644
--- a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/MulticastRouteTest.java
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/MulticastRouteTest.java
@@ -21,54 +21,54 @@ import org.junit.Test;
 
 public class MulticastRouteTest extends CamelAwsXRayTestSupport {
 
-  public MulticastRouteTest() {
-    super(
-        TestDataBuilder.createTrace()
-            .withSegment(TestDataBuilder.createSegment("start")
-                .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_seda_a"))
-            )
-            .withSegment(TestDataBuilder.createSegment("a")
-                .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_seda_b"))
-                .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_seda_c"))
-            )
-            .withSegment(TestDataBuilder.createSegment("b"))
-            .withSegment(TestDataBuilder.createSegment("c")
-                .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_log_routing%20at%20$%7BrouteId%7D"))
-            )
-    );
-  }
+    public MulticastRouteTest() {
+        super(
+            TestDataBuilder.createTrace()
+                .withSegment(TestDataBuilder.createSegment("start")
+                    .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_seda_a"))
+                )
+                .withSegment(TestDataBuilder.createSegment("a")
+                    .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_seda_b"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_seda_c"))
+                )
+                .withSegment(TestDataBuilder.createSegment("b"))
+                .withSegment(TestDataBuilder.createSegment("c")
+                    .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_log_routing%20at%20$%7BrouteId%7D"))
+                )
+        );
+    }
 
-  @Test
-  public void testRoute() throws Exception {
-    template.requestBody("direct:start", "Hello");
+    @Test
+    public void testRoute() throws Exception {
+        template.requestBody("direct:start", "Hello");
 
-    verify();
-  }
+        verify();
+    }
 
-  @Override
-  protected RouteBuilder createRouteBuilder() throws Exception {
-    return new RouteBuilder() {
-      @Override
-      public void configure() throws Exception {
-        from("direct:start").routeId("start")
-            .to("seda:a");
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                from("direct:start").routeId("start")
+                    .to("seda:a");
 
-        from("seda:a").routeId("a")
-            .log("routing at ${routeId}")
-            .multicast()
-            .to("seda:b")
-            .to("seda:c")
-            .end()
-            .log("End of routing");
+                from("seda:a").routeId("a")
+                    .log("routing at ${routeId}")
+                    .multicast()
+                    .to("seda:b")
+                    .to("seda:c")
+                    .end()
+                    .log("End of routing");
 
-        from("seda:b").routeId("b")
-            .log("routing at ${routeId}")
-            .delay(simple("${random(1000,2000)}"));
+                from("seda:b").routeId("b")
+                    .log("routing at ${routeId}")
+                    .delay(simple("${random(1000,2000)}"));
 
-        from("seda:c").routeId("c")
-            .to("log:routing at ${routeId}")
-            .delay(simple("${random(0,100)}"));
-      }
-    };
-  }
+                from("seda:c").routeId("c")
+                    .to("log:routing at ${routeId}")
+                    .delay(simple("${random(0,100)}"));
+            }
+        };
+    }
 }
\ No newline at end of file
diff --git a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/Route2ConcurrentTest.java b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/Route2ConcurrentTest.java
index 906ce12..bb27693 100644
--- a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/Route2ConcurrentTest.java
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/Route2ConcurrentTest.java
@@ -23,53 +23,53 @@ import org.junit.Test;
 
 public class Route2ConcurrentTest extends CamelAwsXRayTestSupport {
 
-  public Route2ConcurrentTest() {
-    super(
-        TestDataBuilder.createTrace().inRandomOrder()
-            .withSegment(TestDataBuilder.createSegment("foo"))
-            .withSegment(TestDataBuilder.createSegment("bar")),
-        TestDataBuilder.createTrace().inRandomOrder()
-            .withSegment(TestDataBuilder.createSegment("foo"))
-            .withSegment(TestDataBuilder.createSegment("bar")),
-        TestDataBuilder.createTrace().inRandomOrder()
-            .withSegment(TestDataBuilder.createSegment("foo"))
-            .withSegment(TestDataBuilder.createSegment("bar")),
-        TestDataBuilder.createTrace().inRandomOrder()
-            .withSegment(TestDataBuilder.createSegment("foo"))
-            .withSegment(TestDataBuilder.createSegment("bar")),
-        TestDataBuilder.createTrace().inRandomOrder()
-            .withSegment(TestDataBuilder.createSegment("foo"))
-            .withSegment(TestDataBuilder.createSegment("bar"))
-    );
-  }
+    public Route2ConcurrentTest() {
+        super(
+            TestDataBuilder.createTrace().inRandomOrder()
+                .withSegment(TestDataBuilder.createSegment("foo"))
+                .withSegment(TestDataBuilder.createSegment("bar")),
+            TestDataBuilder.createTrace().inRandomOrder()
+                .withSegment(TestDataBuilder.createSegment("foo"))
+                .withSegment(TestDataBuilder.createSegment("bar")),
+            TestDataBuilder.createTrace().inRandomOrder()
+                .withSegment(TestDataBuilder.createSegment("foo"))
+                .withSegment(TestDataBuilder.createSegment("bar")),
+            TestDataBuilder.createTrace().inRandomOrder()
+                .withSegment(TestDataBuilder.createSegment("foo"))
+                .withSegment(TestDataBuilder.createSegment("bar")),
+            TestDataBuilder.createTrace().inRandomOrder()
+                .withSegment(TestDataBuilder.createSegment("foo"))
+                .withSegment(TestDataBuilder.createSegment("bar"))
+        );
+    }
 
-  @Test
-  public void testConcurrentInvocationsOfRoute() throws Exception {
-    NotifyBuilder notify = new NotifyBuilder(context).whenDone(10).create();
+    @Test
+    public void testConcurrentInvocationsOfRoute() throws Exception {
+        NotifyBuilder notify = new NotifyBuilder(context).whenDone(10).create();
 
-    for (int i = 0; i < 5; i++) {
-      template.sendBody("seda:foo", "Hello World");
-    }
+        for (int i = 0; i < 5; i++) {
+            template.sendBody("seda:foo", "Hello World");
+        }
 
-    assertTrue(notify.matches(30, TimeUnit.SECONDS));
+        assertTrue(notify.matches(30, TimeUnit.SECONDS));
 
-    verify();
-  }
+        verify();
+    }
 
-  @Override
-  protected RouteBuilder createRouteBuilder() throws Exception {
-    return new RouteBuilder() {
-      @Override
-      public void configure() throws Exception {
-        from("seda:foo?concurrentConsumers=5").routeId("foo")
-            .log("routing at ${routeId}")
-            .delay(simple("${random(1000,2000)}"))
-            .to("seda:bar");
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                from("seda:foo?concurrentConsumers=5").routeId("foo")
+                    .log("routing at ${routeId}")
+                    .delay(simple("${random(1000,2000)}"))
+                    .to("seda:bar");
 
-        from("seda:bar?concurrentConsumers=5").routeId("bar")
-            .log("routing at ${routeId}")
-            .delay(simple("${random(0,500)}"));
-      }
-    };
-  }
+                from("seda:bar?concurrentConsumers=5").routeId("bar")
+                    .log("routing at ${routeId}")
+                    .delay(simple("${random(0,500)}"));
+            }
+        };
+    }
 }
\ No newline at end of file
diff --git a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/RouteConcurrentTest.java b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/RouteConcurrentTest.java
index 209977f..d5ee9b0 100644
--- a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/RouteConcurrentTest.java
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/RouteConcurrentTest.java
@@ -23,39 +23,39 @@ import org.junit.Test;
 
 public class RouteConcurrentTest extends CamelAwsXRayTestSupport {
 
-  public RouteConcurrentTest() {
-    super(
-        TestDataBuilder.createTrace().inRandomOrder()
-            .withSegment(TestDataBuilder.createSegment("foo"))
-            .withSegment(TestDataBuilder.createSegment("bar"))
-    );
-  }
-
-  @Test
-  public void testRoute() throws Exception {
-    NotifyBuilder notify = new NotifyBuilder(context).whenDone(2).create();
-
-    template.sendBody("seda:foo", "Hello World");
-
-    assertTrue(notify.matches(30, TimeUnit.SECONDS));
-
-    verify();
-  }
-
-  @Override
-  protected RouteBuilder createRouteBuilder() throws Exception {
-    return new RouteBuilder() {
-      @Override
-      public void configure() throws Exception {
-        from("seda:foo?concurrentConsumers=5").routeId("foo")
-            .log("routing at ${routeId}")
-            .delay(simple("${random(1000,2000)}"))
-            .to("seda:bar");
-
-        from("seda:bar?concurrentConsumers=5").routeId("bar")
-            .log("routing at ${routeId}")
-            .delay(simple("${random(0,500)}"));
-      }
-    };
-  }
+    public RouteConcurrentTest() {
+        super(
+            TestDataBuilder.createTrace().inRandomOrder()
+                .withSegment(TestDataBuilder.createSegment("foo"))
+                .withSegment(TestDataBuilder.createSegment("bar"))
+        );
+    }
+
+    @Test
+    public void testRoute() throws Exception {
+        NotifyBuilder notify = new NotifyBuilder(context).whenDone(2).create();
+
+        template.sendBody("seda:foo", "Hello World");
+
+        assertTrue(notify.matches(30, TimeUnit.SECONDS));
+
+        verify();
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                from("seda:foo?concurrentConsumers=5").routeId("foo")
+                    .log("routing at ${routeId}")
+                    .delay(simple("${random(1000,2000)}"))
+                    .to("seda:bar");
+
+                from("seda:bar?concurrentConsumers=5").routeId("bar")
+                    .log("routing at ${routeId}")
+                    .delay(simple("${random(0,500)}"));
+            }
+        };
+    }
 }
\ No newline at end of file
diff --git a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/SpringAwsXRaySimpleRouteTest.java b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/SpringAwsXRaySimpleRouteTest.java
index 95ee026..acb6f1a 100644
--- a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/SpringAwsXRaySimpleRouteTest.java
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/SpringAwsXRaySimpleRouteTest.java
@@ -29,25 +29,25 @@ import org.springframework.context.support.ClassPathXmlApplicationContext;
 
 public class SpringAwsXRaySimpleRouteTest extends CamelSpringTestSupport {
 
-  @Rule
-  public FakeAWSDaemon socketListener = new FakeAWSDaemon();
+    @Rule
+    public FakeAWSDaemon socketListener = new FakeAWSDaemon();
 
-  @Override
-  protected AbstractApplicationContext createApplicationContext() {
-    return new ClassPathXmlApplicationContext("/org/apache/camel/aws/xray/AwsXRaySimpleRouteTest.xml");
-  }
+    @Override
+    protected AbstractApplicationContext createApplicationContext() {
+        return new ClassPathXmlApplicationContext("org/apache/camel/aws/xray/AwsXRaySimpleRouteTest.xml");
+    }
 
-  @Test
-  public void testRoute() throws Exception {
-    NotifyBuilder notify = new NotifyBuilder(context).whenDone(5).create();
+    @Test
+    public void testRoute() throws Exception {
+        NotifyBuilder notify = new NotifyBuilder(context).whenDone(5).create();
 
-    for (int i = 0; i < 5; i++) {
-      template.sendBody("seda:dude", "Hello World");
-    }
+        for (int i = 0; i < 5; i++) {
+            template.sendBody("seda:dude", "Hello World");
+        }
 
-    assertTrue(notify.matches(30, TimeUnit.SECONDS));
+        assertTrue(notify.matches(30, TimeUnit.SECONDS));
 
-    List<TestTrace> testData = Arrays.asList(
+        List<TestTrace> testData = Arrays.asList(
         TestDataBuilder.createTrace()
             .withSegment(TestDataBuilder.createSegment("dude")
                 .withSubsegment(TestDataBuilder.createSubsegment("car"))
@@ -68,10 +68,10 @@ public class SpringAwsXRaySimpleRouteTest extends CamelSpringTestSupport {
             .withSegment(TestDataBuilder.createSegment("dude")
                 .withSubsegment(TestDataBuilder.createSubsegment("car"))
             )
-    );
+        );
 
-    Thread.sleep(2000);
+        Thread.sleep(2000);
 
-    TestUtils.checkData(socketListener.getReceivedData(), testData);
-  }
+        TestUtils.checkData(socketListener.getReceivedData(), testData);
+    }
 }
\ No newline at end of file
diff --git a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/TestDataBuilder.java b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/TestDataBuilder.java
index badd327..000f882 100644
--- a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/TestDataBuilder.java
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/TestDataBuilder.java
@@ -24,187 +24,191 @@ import java.util.Set;
 import java.util.TreeSet;
 
 @SuppressWarnings({"WeakerAccess", "unchecked"})
-class TestDataBuilder {
-
-  static class TestTrace {
-
-    private boolean randomOrder = false;
-    private Set<TestSegment> segments = new TreeSet<>((TestSegment seg1, TestSegment seg2) -> {
-      if (seg1.equals(seg2)) {
-        return 0;
-      }
-      if (seg1.startTime != 0 && seg2.startTime != 0) {
-        if (seg1.startTime == seg2.startTime) {
-          return -1;
-        }
-        return seg1.startTime < seg2.startTime ? -1 : 1;
-      } else {
-        return 1;
-      }
-    });
-
-    public TestTrace withSegment(TestSegment segment) {
-      this.segments.add(segment);
-      return this;
-    }
+final class TestDataBuilder {
 
-    public Set<TestSegment> getSegments() {
-      return segments;
-    }
+    private TestDataBuilder() {
 
-    public TestTrace inRandomOrder() {
-      randomOrder = true;
-      return this;
     }
 
-    public boolean isRandomOrder() {
-      return randomOrder;
-    }
-  }
+    static class TestTrace {
 
-  public static abstract class TestEntity<T> {
-    protected String name;
-    protected Map<String, Object> annotations = new LinkedHashMap<>();
-    protected Map<String, Map<String, Object>> metadata = new LinkedHashMap<>();
-    protected List<TestSubsegment> subsegments = new ArrayList<>();
-    protected boolean randomOrder = false;
+        private boolean randomOrder;
+        private Set<TestSegment> segments = new TreeSet<>((TestSegment seg1, TestSegment seg2) -> {
+            if (seg1.equals(seg2)) {
+                return 0;
+            }
+            if (seg1.startTime != 0 && seg2.startTime != 0) {
+                if (seg1.startTime == seg2.startTime) {
+                    return -1;
+                }
+                return seg1.startTime < seg2.startTime ? -1 : 1;
+            } else {
+                return 1;
+            }
+        });
 
-    protected TestEntity(String name) {
-      this.name = name;
-    }
+        public TestTrace withSegment(TestSegment segment) {
+            this.segments.add(segment);
+            return this;
+        }
 
-    public String getName() {
-      return name;
-    }
+        public Set<TestSegment> getSegments() {
+            return segments;
+        }
 
-    public Map<String, Object> getAnnotations() {
-      return this.annotations;
-    }
+        public TestTrace inRandomOrder() {
+            randomOrder = true;
+            return this;
+        }
 
-    public Map<String, Map<String, Object>> getMetadata() {
-      return metadata;
+        public boolean isRandomOrder() {
+            return randomOrder;
+        }
     }
 
-    public List<TestSubsegment> getSubsegments() {
-      return subsegments;
-    }
+    public abstract static class TestEntity<T> {
+        protected String name;
+        protected Map<String, Object> annotations = new LinkedHashMap<>();
+        protected Map<String, Map<String, Object>> metadata = new LinkedHashMap<>();
+        protected List<TestSubsegment> subsegments = new ArrayList<>();
+        protected boolean randomOrder;
 
-    public T withAnnotation(String name, Object value) {
-      this.annotations.put(name, value);
-      return (T)this;
-    }
+        protected TestEntity(String name) {
+            this.name = name;
+        }
 
-    public T withMetadata(String name, Object value) {
-      return this.withMetadata("default", name, value);
-    }
+        public String getName() {
+            return name;
+        }
 
-    public T withMetadata(String namespace, String name, Object value) {
-      if (!this.metadata.containsKey(namespace)) {
-        this.metadata.put(namespace, new LinkedHashMap<>());
-      }
-      Map<String, Object> namespaceMap = this.metadata.get(namespace);
-      namespaceMap.put(name, value);
-      return (T)this;
-    }
+        public Map<String, Object> getAnnotations() {
+            return this.annotations;
+        }
 
-    public T withSubsegment(TestSubsegment subsegment) {
-      this.subsegments.add(subsegment);
-      return (T)this;
-    }
+        public Map<String, Map<String, Object>> getMetadata() {
+            return metadata;
+        }
 
-    public T inRandomOrder() {
-      this.randomOrder = true;
-      return (T)this;
-    }
+        public List<TestSubsegment> getSubsegments() {
+            return subsegments;
+        }
 
-    public boolean isRandomOrder() {
-      return randomOrder;
-    }
+        public T withAnnotation(String name, Object value) {
+            this.annotations.put(name, value);
+            return (T) this;
+        }
+
+        public T withMetadata(String name, Object value) {
+            return this.withMetadata("default", name, value);
+        }
 
-    @Override
-    public String toString() {
-      String ret = this.getClass().getSimpleName() + "(name: " + name;
-
-      if (!subsegments.isEmpty()) {
-        ret += ", subsegments: [";
-        StringBuilder sb = new StringBuilder();
-        for (TestSubsegment sub : subsegments) {
-          if (sb.length() > 0) {
-            sb.append(", ");
-          }
-          sb.append(sub);
-        }
-        ret += sb.toString()+"]";
-      }
-      if (!annotations.isEmpty()) {
-        ret += ", annotations: {";
-        StringBuilder sb = new StringBuilder();
-        for (String key:  annotations.keySet()) {
-          if (sb.length() > 0) {
-            sb.append(", ");
-          }
-          sb.append(key).append("->").append(annotations.get(key));
-        }
-        ret += sb.toString() + "}";
-      }
-      if (!metadata.isEmpty()) {
-        ret += ", metadata: {";
-        StringBuilder sb = new StringBuilder();
-        for (String namespace : metadata.keySet()) {
-          if (sb.length() > 0) {
-            sb.append(", ");
-          }
-          sb.append(namespace).append(": [");
-          boolean first = true;
-          for (String key : metadata.get(namespace).keySet()) {
-            if (!first) {
-              sb.append(", ");
+        public T withMetadata(String namespace, String name, Object value) {
+            if (!this.metadata.containsKey(namespace)) {
+                this.metadata.put(namespace, new LinkedHashMap<>());
             }
-            sb.append(key).append("->").append(metadata.get(namespace).get(key));
-            first = false;
-          }
-          sb.append("]");
-        }
-        ret += sb.toString() + "}";
-      }
-      ret += ")";
-      return ret;
-    }
-  }
+            Map<String, Object> namespaceMap = this.metadata.get(namespace);
+            namespaceMap.put(name, value);
+            return (T) this;
+        }
+
+        public T withSubsegment(TestSubsegment subsegment) {
+            this.subsegments.add(subsegment);
+            return (T) this;
+        }
 
-  static class TestSegment extends TestEntity<TestSegment> {
-    private double startTime;
+        public T inRandomOrder() {
+            this.randomOrder = true;
+            return (T) this;
+        }
 
-    public TestSegment(String name) {
-      super(name);
-    }
+        public boolean isRandomOrder() {
+            return randomOrder;
+        }
 
-    public TestSegment(String name, double startTime) {
-      this(name);
-      this.startTime = startTime;
+        @Override
+        public String toString() {
+            String ret = this.getClass().getSimpleName() + "(name: " + name;
+
+            if (!subsegments.isEmpty()) {
+                ret += ", subsegments: [";
+                StringBuilder sb = new StringBuilder();
+                for (TestSubsegment sub : subsegments) {
+                    if (sb.length() > 0) {
+                        sb.append(", ");
+                    }
+                    sb.append(sub);
+                }
+                ret += sb.toString() + "]";
+            }
+            if (!annotations.isEmpty()) {
+                ret += ", annotations: {";
+                StringBuilder sb = new StringBuilder();
+                for (String key : annotations.keySet()) {
+                    if (sb.length() > 0) {
+                        sb.append(", ");
+                    }
+                    sb.append(key).append("->").append(annotations.get(key));
+                }
+                ret += sb.toString() + "}";
+            }
+            if (!metadata.isEmpty()) {
+                ret += ", metadata: {";
+                StringBuilder sb = new StringBuilder();
+                for (String namespace : metadata.keySet()) {
+                    if (sb.length() > 0) {
+                        sb.append(", ");
+                    }
+                    sb.append(namespace).append(": [");
+                    boolean first = true;
+                    for (String key : metadata.get(namespace).keySet()) {
+                        if (!first) {
+                            sb.append(", ");
+                        }
+                        sb.append(key).append("->").append(metadata.get(namespace).get(key));
+                        first = false;
+                    }
+                    sb.append("]");
+                }
+                ret += sb.toString() + "}";
+            }
+            ret += ")";
+            return ret;
+        }
     }
 
-    public double getStartTime() {
-      return this.startTime;
+    static class TestSegment extends TestEntity<TestSegment> {
+        private double startTime;
+
+        public TestSegment(String name) {
+            super(name);
+        }
+
+        public TestSegment(String name, double startTime) {
+            this(name);
+            this.startTime = startTime;
+        }
+
+        public double getStartTime() {
+            return this.startTime;
+        }
     }
-  }
 
-  static class TestSubsegment extends TestEntity<TestSubsegment> {
+    static class TestSubsegment extends TestEntity<TestSubsegment> {
 
-    public TestSubsegment(String name) {
-      super(name);
+        public TestSubsegment(String name) {
+            super(name);
+        }
     }
-  }
 
-  public static TestTrace createTrace() {
-    return new TestTrace();
-  }
+    public static TestTrace createTrace() {
+        return new TestTrace();
+    }
 
-  public static TestSegment createSegment(String name) {
-    return new TestSegment(name);
-  }
+    public static TestSegment createSegment(String name) {
+        return new TestSegment(name);
+    }
 
-  public static TestSubsegment createSubsegment(String name) {
-    return new TestSubsegment(name);
-  }
+    public static TestSubsegment createSubsegment(String name) {
+        return new TestSubsegment(name);
+    }
 }
\ No newline at end of file
diff --git a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/TestUtils.java b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/TestUtils.java
index 03f1f1c..bd3933d 100644
--- a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/TestUtils.java
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/TestUtils.java
@@ -16,146 +16,151 @@
  */
 package org.apache.camel.component.aws.xray;
 
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.greaterThanOrEqualTo;
-import static org.hamcrest.core.IsEqual.equalTo;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
+
 import org.apache.camel.component.aws.xray.TestDataBuilder.TestSegment;
 import org.apache.camel.component.aws.xray.TestDataBuilder.TestSubsegment;
 import org.apache.camel.component.aws.xray.TestDataBuilder.TestTrace;
 
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.greaterThanOrEqualTo;
+import static org.hamcrest.core.IsEqual.equalTo;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 public final class TestUtils {
 
-  public static void checkData(Map<String, TestTrace> receivedData, List<TestTrace> testData) {
-    assertThat("Incorrect number of traces",
-        receivedData.size(), is(equalTo(testData.size())));
-    int i = 0;
-    for (String key : receivedData.keySet()) {
-      TestTrace trace = receivedData.get(key);
-      verifyTraces(testData.get(i++), trace);
+    private TestUtils() {
+
     }
-  }
-
-  private static void verifyTraces(TestTrace expected, TestTrace actual) {
-    assertThat("Incorrect number of segment for trace",
-        actual.getSegments().size(), is(equalTo(expected.getSegments().size())));
-    List<TestSegment> expectedSegments = new ArrayList<>(expected.getSegments());
-    List<TestSegment> actualSegments = new ArrayList<>(actual.getSegments());
-
-    boolean randomOrder = expected.isRandomOrder();
-    for (int i = 0; i < expected.getSegments().size(); i++) {
-
-      if (randomOrder) {
-        for (TestSegment expectedSeg : expectedSegments) {
-          boolean found = false;
-          for (TestSegment actualSeg : actualSegments) {
-            if (expectedSeg.getName().equals(actualSeg.getName())) {
-              found = true;
-              verifySegments(expectedSeg, actualSeg);
-              break;
-            }
-          }
-          if (!found) {
-            fail("Could not find expected segment " + expectedSeg.getName());
-          }
+
+    public static void checkData(Map<String, TestTrace> receivedData, List<TestTrace> testData) {
+        assertThat("Incorrect number of traces",
+                receivedData.size(), is(equalTo(testData.size())));
+        int i = 0;
+        for (String key : receivedData.keySet()) {
+            TestTrace trace = receivedData.get(key);
+            verifyTraces(testData.get(i++), trace);
         }
-      } else {
-        verifySegments(expectedSegments.get(i), actualSegments.get(i));
-      }
     }
-  }
-
-  private static void verifySegments(TestSegment expected, TestSegment actual) {
-    assertThat("Incorrect name of segment",
-        actual.getName(), is(equalTo(expected.getName())));
-
-    boolean randomOrder = expected.isRandomOrder();
-    if (!expected.getSubsegments().isEmpty()) {
-      if (randomOrder) {
-        checkSubsegmentInRandomOrder(expected.getSubsegments(), actual.getSubsegments());
-      } else {
-        for (int i = 0; i < expected.getSubsegments().size(); i++) {
-          if (actual.getName().equals(expected.getName())) {
-            verifySubsegments(expected.getSubsegments().get(i), actual.getSubsegments().get(i));
-          }
+
+    private static void verifyTraces(TestTrace expected, TestTrace actual) {
+        assertThat("Incorrect number of segment for trace",
+                actual.getSegments().size(), is(equalTo(expected.getSegments().size())));
+        List<TestSegment> expectedSegments = new ArrayList<>(expected.getSegments());
+        List<TestSegment> actualSegments = new ArrayList<>(actual.getSegments());
+
+        boolean randomOrder = expected.isRandomOrder();
+        for (int i = 0; i < expected.getSegments().size(); i++) {
+
+            if (randomOrder) {
+                for (TestSegment expectedSeg : expectedSegments) {
+                    boolean found = false;
+                    for (TestSegment actualSeg : actualSegments) {
+                        if (expectedSeg.getName().equals(actualSeg.getName())) {
+                            found = true;
+                            verifySegments(expectedSeg, actualSeg);
+                            break;
+                        }
+                    }
+                    if (!found) {
+                        fail("Could not find expected segment " + expectedSeg.getName());
+                    }
+                }
+            } else {
+                verifySegments(expectedSegments.get(i), actualSegments.get(i));
+            }
         }
-      }
-    }
-    if (!expected.getAnnotations().isEmpty()) {
-      verifyAnnotations(expected.getAnnotations(), actual.getAnnotations());
     }
-    if (!expected.getMetadata().isEmpty()) {
-      verifyMetadata(expected.getMetadata(), actual.getMetadata());
-    }
-  }
-
-  private static void verifySubsegments(TestSubsegment expected, TestSubsegment actual) {
-    assertThat("Incorrect name of subsegment",
-        actual.getName(), is(equalTo(expected.getName())));
-
-    boolean randomOrder = expected.isRandomOrder();
-    if (!expected.getSubsegments().isEmpty()) {
-      if (randomOrder) {
-        checkSubsegmentInRandomOrder(expected.getSubsegments(), actual.getSubsegments());
-      } else {
-        for (int i = 0; i < expected.getSubsegments().size(); i++) {
-          verifySubsegments(expected.getSubsegments().get(i), actual.getSubsegments().get(i));
+
+    private static void verifySegments(TestSegment expected, TestSegment actual) {
+        assertThat("Incorrect name of segment",
+                actual.getName(), is(equalTo(expected.getName())));
+
+        boolean randomOrder = expected.isRandomOrder();
+        if (!expected.getSubsegments().isEmpty()) {
+            if (randomOrder) {
+                checkSubsegmentInRandomOrder(expected.getSubsegments(), actual.getSubsegments());
+            } else {
+                for (int i = 0; i < expected.getSubsegments().size(); i++) {
+                    if (actual.getName().equals(expected.getName())) {
+                        verifySubsegments(expected.getSubsegments().get(i), actual.getSubsegments().get(i));
+                    }
+                }
+            }
+        }
+        if (!expected.getAnnotations().isEmpty()) {
+            verifyAnnotations(expected.getAnnotations(), actual.getAnnotations());
+        }
+        if (!expected.getMetadata().isEmpty()) {
+            verifyMetadata(expected.getMetadata(), actual.getMetadata());
         }
-      }
-    }
-    if (!expected.getAnnotations().isEmpty()) {
-      verifyAnnotations(expected.getAnnotations(), actual.getAnnotations());
     }
-    if (!expected.getMetadata().isEmpty()) {
-      verifyMetadata(expected.getMetadata(), actual.getMetadata());
+
+    private static void verifySubsegments(TestSubsegment expected, TestSubsegment actual) {
+        assertThat("Incorrect name of subsegment",
+                actual.getName(), is(equalTo(expected.getName())));
+
+        boolean randomOrder = expected.isRandomOrder();
+        if (!expected.getSubsegments().isEmpty()) {
+            if (randomOrder) {
+                checkSubsegmentInRandomOrder(expected.getSubsegments(), actual.getSubsegments());
+            } else {
+                for (int i = 0; i < expected.getSubsegments().size(); i++) {
+                    verifySubsegments(expected.getSubsegments().get(i), actual.getSubsegments().get(i));
+                }
+            }
+        }
+        if (!expected.getAnnotations().isEmpty()) {
+            verifyAnnotations(expected.getAnnotations(), actual.getAnnotations());
+        }
+        if (!expected.getMetadata().isEmpty()) {
+            verifyMetadata(expected.getMetadata(), actual.getMetadata());
+        }
     }
-  }
-
-  private static void checkSubsegmentInRandomOrder(List<TestSubsegment> expectedSubs, List<TestSubsegment> actualSubs) {
-    for (TestSubsegment expectedSub : expectedSubs) {
-      boolean found = false;
-      for (TestSubsegment actualSub : actualSubs) {
-        if (expectedSub.getName().equals(actualSub.getName())) {
-          found = true;
-          verifySubsegments(expectedSub, actualSub);
-          break;
+
+    private static void checkSubsegmentInRandomOrder(List<TestSubsegment> expectedSubs, List<TestSubsegment> actualSubs) {
+        for (TestSubsegment expectedSub : expectedSubs) {
+            boolean found = false;
+            for (TestSubsegment actualSub : actualSubs) {
+                if (expectedSub.getName().equals(actualSub.getName())) {
+                    found = true;
+                    verifySubsegments(expectedSub, actualSub);
+                    break;
+                }
+            }
+            if (!found) {
+                fail("Could not find expected sub-segment " + expectedSub.getName());
+            }
         }
-      }
-      if (!found) {
-        fail("Could not find expected sub-segment " + expectedSub.getName());
-      }
     }
-  }
-
-  private static void verifyAnnotations(Map<String, Object> expected, Map<String, Object> actual) {
-    assertThat(actual.size(), is(equalTo(expected.size())));
-    for (String key : expected.keySet()) {
-      assertTrue("Annotation " + key + " is missing", actual.containsKey(key));
-      assertThat("Annotation value of " + key + " is different",
-          actual.get(key), is(equalTo(expected.get(key))));
+
+    private static void verifyAnnotations(Map<String, Object> expected, Map<String, Object> actual) {
+        assertThat(actual.size(), is(equalTo(expected.size())));
+        for (String key : expected.keySet()) {
+            assertTrue("Annotation " + key + " is missing", actual.containsKey(key));
+            assertThat("Annotation value of " + key + " is different",
+                    actual.get(key), is(equalTo(expected.get(key))));
+        }
     }
-  }
-
-  private static void verifyMetadata(Map<String, Map<String, Object>> expected,
-      Map<String, Map<String, Object>> actual) {
-
-    assertThat("Insufficient number of metadata found",
-        actual.size(), is(greaterThanOrEqualTo(expected.size())));
-    for (String namespace : expected.keySet()) {
-      assertTrue("Namespace " + namespace + " not found in metadata",
-          actual.containsKey(namespace));
-      for (String key : expected.get(namespace).keySet()) {
-        assertTrue("Key " + key + " of namespace + " + namespace + " not found",
-            actual.get(namespace).containsKey(key));
-        assertThat("Incorrect value of key " + key + " in namespace " + namespace,
-            actual.get(namespace).get(key), is(equalTo(expected.get(namespace).get(key))));
-      }
+
+    private static void verifyMetadata(Map<String, Map<String, Object>> expected,
+                                       Map<String, Map<String, Object>> actual) {
+
+        assertThat("Insufficient number of metadata found",
+                actual.size(), is(greaterThanOrEqualTo(expected.size())));
+        for (String namespace : expected.keySet()) {
+            assertTrue("Namespace " + namespace + " not found in metadata",
+                    actual.containsKey(namespace));
+            for (String key : expected.get(namespace).keySet()) {
+                assertTrue("Key " + key + " of namespace + " + namespace + " not found",
+                        actual.get(namespace).containsKey(key));
+                assertThat("Incorrect value of key " + key + " in namespace " + namespace,
+                        actual.get(namespace).get(key), is(equalTo(expected.get(namespace).get(key))));
+            }
+        }
     }
-  }
 }
\ No newline at end of file
diff --git a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/TwoService2Test.java b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/TwoService2Test.java
index 19575bc..2e07219 100644
--- a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/TwoService2Test.java
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/TwoService2Test.java
@@ -22,39 +22,39 @@ import org.junit.Test;
 
 public class TwoService2Test extends CamelAwsXRayTestSupport {
 
-  public TwoService2Test() {
-    super(
-        TestDataBuilder.createTrace().inRandomOrder()
-            .withSegment(TestDataBuilder.createSegment("route1")
-                .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_direct_ServiceB")
-                    .withSubsegment(TestDataBuilder.createSubsegment("route2"))
+    public TwoService2Test() {
+        super(
+            TestDataBuilder.createTrace().inRandomOrder()
+                .withSegment(TestDataBuilder.createSegment("route1")
+                    .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_direct_ServiceB")
+                        .withSubsegment(TestDataBuilder.createSubsegment("route2"))
+                    )
                 )
-            )
-    );
-  }
+        );
+    }
 
-  @Test
-  public void testRoute() throws Exception {
-    template.requestBody("direct:ServiceA", "Hello");
+    @Test
+    public void testRoute() throws Exception {
+        template.requestBody("direct:ServiceA", "Hello");
 
-    Thread.sleep(500);
-    verify();
-  }
+        Thread.sleep(500);
+        verify();
+    }
 
-  @Override
-  protected RoutesBuilder createRouteBuilder() throws Exception {
-    return new RouteBuilder() {
-      @Override
-      public void configure() throws Exception {
-        from("direct:ServiceA")
-            .log("ServiceA has been called")
-            .delay(simple("${random(1000,2000)}"))
-            .to("direct:ServiceB");
+    @Override
+    protected RoutesBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                from("direct:ServiceA")
+                    .log("ServiceA has been called")
+                    .delay(simple("${random(1000,2000)}"))
+                    .to("direct:ServiceB");
 
-        from("direct:ServiceB")
-            .log("ServiceB has been called")
-            .delay(simple("${random(0,500)}"));
-      }
-    };
-  }
+                from("direct:ServiceB")
+                    .log("ServiceB has been called")
+                    .delay(simple("${random(0,500)}"));
+            }
+        };
+    }
 }
\ No newline at end of file
diff --git a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/TwoServiceTest.java b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/TwoServiceTest.java
index 2efa720..edf6aad 100644
--- a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/TwoServiceTest.java
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/TwoServiceTest.java
@@ -22,39 +22,39 @@ import org.junit.Test;
 
 public class TwoServiceTest extends CamelAwsXRayTestSupport {
 
-  public TwoServiceTest() {
-    super(
-        TestDataBuilder.createTrace().inRandomOrder()
-            .withSegment(TestDataBuilder.createSegment("ServiceA")
-                .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_direct_ServiceB")
-                    .withSubsegment(TestDataBuilder.createSubsegment("ServiceB"))
+    public TwoServiceTest() {
+        super(
+            TestDataBuilder.createTrace().inRandomOrder()
+                .withSegment(TestDataBuilder.createSegment("ServiceA")
+                    .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_direct_ServiceB")
+                        .withSubsegment(TestDataBuilder.createSubsegment("ServiceB"))
+                    )
                 )
-            )
-    );
-  }
+        );
+    }
 
-  @Test
-  public void testRoute() throws Exception {
-    template.requestBody("direct:ServiceA", "Hello");
+    @Test
+    public void testRoute() throws Exception {
+        template.requestBody("direct:ServiceA", "Hello");
 
-    Thread.sleep(500);
-    verify();
-  }
+        Thread.sleep(500);
+        verify();
+    }
 
-  @Override
-  protected RoutesBuilder createRouteBuilder() throws Exception {
-    return new RouteBuilder() {
-      @Override
-      public void configure() throws Exception {
-        from("direct:ServiceA").routeId("ServiceA")
-            .log("ServiceA has been called")
-            .delay(simple("${random(1000,2000)}"))
-            .to("direct:ServiceB");
+    @Override
+    protected RoutesBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                from("direct:ServiceA").routeId("ServiceA")
+                    .log("ServiceA has been called")
+                    .delay(simple("${random(1000,2000)}"))
+                    .to("direct:ServiceB");
 
-        from("direct:ServiceB").routeId("ServiceB")
-            .log("ServiceB has been called")
-            .delay(simple("${random(0,500)}"));
-      }
-    };
-  }
+                from("direct:ServiceB").routeId("ServiceB")
+                    .log("ServiceB has been called")
+                    .delay(simple("${random(0,500)}"));
+            }
+        };
+    }
 }
\ No newline at end of file
diff --git a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/TwoServiceWithExcludeTest.java b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/TwoServiceWithExcludeTest.java
index 84f049c..5f2fac5 100644
--- a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/TwoServiceWithExcludeTest.java
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/TwoServiceWithExcludeTest.java
@@ -24,42 +24,42 @@ import org.junit.Test;
 
 public class TwoServiceWithExcludeTest extends CamelAwsXRayTestSupport {
 
-  public TwoServiceWithExcludeTest() {
-    super(
-        TestDataBuilder.createTrace().inRandomOrder()
-            .withSegment(TestDataBuilder.createSegment("ServiceA")
-                .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_direct_ServiceB"))
-            )
-    );
-  }
+    public TwoServiceWithExcludeTest() {
+        super(
+            TestDataBuilder.createTrace().inRandomOrder()
+                .withSegment(TestDataBuilder.createSegment("ServiceA")
+                    .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_direct_ServiceB"))
+                )
+        );
+    }
 
-  @Override
-  protected Set<String> getExcludePatterns() {
-    return Collections.singleton("ServiceB");
-  }
+    @Override
+    protected Set<String> getExcludePatterns() {
+        return Collections.singleton("ServiceB");
+    }
 
-  @Test
-  public void testRoute() throws Exception {
-    template.requestBody("direct:ServiceA", "Hello");
+    @Test
+    public void testRoute() throws Exception {
+        template.requestBody("direct:ServiceA", "Hello");
 
-    Thread.sleep(500);
-    verify();
-  }
+        Thread.sleep(500);
+        verify();
+    }
 
-  @Override
-  protected RoutesBuilder createRouteBuilder() throws Exception {
-    return new RouteBuilder() {
-      @Override
-      public void configure() throws Exception {
-        from("direct:ServiceA").routeId("ServiceA")
-            .log("ServiceA has been called")
-            .delay(simple("${random(1000,2000)}"))
-            .to("direct:ServiceB");
+    @Override
+    protected RoutesBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                from("direct:ServiceA").routeId("ServiceA")
+                    .log("ServiceA has been called")
+                    .delay(simple("${random(1000,2000)}"))
+                    .to("direct:ServiceB");
 
-        from("direct:ServiceB").routeId("ServiceB")
-            .log("ServiceB has been called")
-            .delay(simple("${random(0,500)}"));
-      }
-    };
-  }
+                from("direct:ServiceB").routeId("ServiceB")
+                    .log("ServiceB has been called")
+                    .delay(simple("${random(0,500)}"));
+            }
+        };
+    }
 }
\ No newline at end of file
diff --git a/components/camel-aws-xray/src/test/resources/logback-test.xml b/components/camel-aws-xray/src/test/resources/logback-test.xml
index ad0fd41..c37384f 100644
--- a/components/camel-aws-xray/src/test/resources/logback-test.xml
+++ b/components/camel-aws-xray/src/test/resources/logback-test.xml
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
+
     Licensed to the Apache Software Foundation (ASF) under one or more
     contributor license agreements.  See the NOTICE file distributed with
     this work for additional information regarding copyright ownership.
@@ -7,13 +8,14 @@
     (the "License"); you may not use this file except in compliance with
     the License.  You may obtain a copy of the License at
 
-    http://www.apache.org/licenses/LICENSE-2.0
+         http://www.apache.org/licenses/LICENSE-2.0
 
     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
+
 -->
 <configuration debug="true">
 
diff --git a/components/camel-aws-xray/src/test/resources/org.apache.camel.aws.xray/AwsXRaySimpleRouteTest.xml b/components/camel-aws-xray/src/test/resources/org/apache/camel/aws/xray/AwsXRaySimpleRouteTest.xml
similarity index 97%
rename from components/camel-aws-xray/src/test/resources/org.apache.camel.aws.xray/AwsXRaySimpleRouteTest.xml
rename to components/camel-aws-xray/src/test/resources/org/apache/camel/aws/xray/AwsXRaySimpleRouteTest.xml
index 016d3c0..51d536b 100644
--- a/components/camel-aws-xray/src/test/resources/org.apache.camel.aws.xray/AwsXRaySimpleRouteTest.xml
+++ b/components/camel-aws-xray/src/test/resources/org/apache/camel/aws/xray/AwsXRaySimpleRouteTest.xml
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
+
     Licensed to the Apache Software Foundation (ASF) under one or more
     contributor license agreements.  See the NOTICE file distributed with
     this work for additional information regarding copyright ownership.
@@ -7,13 +8,14 @@
     (the "License"); you may not use this file except in compliance with
     the License.  You may obtain a copy of the License at
 
-    http://www.apache.org/licenses/LICENSE-2.0
+         http://www.apache.org/licenses/LICENSE-2.0
 
     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
+
 -->
 <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
diff --git a/platforms/spring-boot/components-starter/camel-aws-xray-starter/pom.xml b/platforms/spring-boot/components-starter/camel-aws-xray-starter/pom.xml
new file mode 100644
index 0000000..3a29f08
--- /dev/null
+++ b/platforms/spring-boot/components-starter/camel-aws-xray-starter/pom.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.apache.camel</groupId>
+    <artifactId>components-starter</artifactId>
+    <version>2.21.0-SNAPSHOT</version>
+  </parent>
+  <artifactId>camel-aws-xray-starter</artifactId>
+  <packaging>jar</packaging>
+  <name>Spring-Boot Starter :: Camel :: AWS :: XRay</name>
+  <description>Spring-Boot Starter for Distributed tracing using AWS XRay</description>
+  <dependencies>
+    <dependency>
+      <groupId>org.springframework.boot</groupId>
+      <artifactId>spring-boot-starter</artifactId>
+      <version>${spring-boot-version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-aws-xray</artifactId>
+      <version>${project.version}</version>
+      <!--START OF GENERATED CODE-->
+      <exclusions>
+        <exclusion>
+          <groupId>commons-logging</groupId>
+          <artifactId>commons-logging</artifactId>
+        </exclusion>
+      </exclusions>
+      <!--END OF GENERATED CODE-->
+    </dependency>
+    <!--START OF GENERATED CODE-->
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-core-starter</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-spring-boot-starter</artifactId>
+    </dependency>
+    <!--END OF GENERATED CODE-->
+  </dependencies>
+</project>
diff --git a/platforms/spring-boot/components-starter/camel-aws-xray-starter/src/main/resources/META-INF/LICENSE.txt b/platforms/spring-boot/components-starter/camel-aws-xray-starter/src/main/resources/META-INF/LICENSE.txt
new file mode 100644
index 0000000..6b0b127
--- /dev/null
+++ b/platforms/spring-boot/components-starter/camel-aws-xray-starter/src/main/resources/META-INF/LICENSE.txt
@@ -0,0 +1,203 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
diff --git a/platforms/spring-boot/components-starter/camel-aws-xray-starter/src/main/resources/META-INF/NOTICE.txt b/platforms/spring-boot/components-starter/camel-aws-xray-starter/src/main/resources/META-INF/NOTICE.txt
new file mode 100644
index 0000000..2e215bf
--- /dev/null
+++ b/platforms/spring-boot/components-starter/camel-aws-xray-starter/src/main/resources/META-INF/NOTICE.txt
@@ -0,0 +1,11 @@
+   =========================================================================
+   ==  NOTICE file corresponding to the section 4 d of                    ==
+   ==  the Apache License, Version 2.0,                                   ==
+   ==  in this case for the Apache Camel distribution.                    ==
+   =========================================================================
+
+   This product includes software developed by
+   The Apache Software Foundation (http://www.apache.org/).
+
+   Please read the different LICENSE files present in the licenses directory of
+   this distribution.
diff --git a/platforms/spring-boot/components-starter/camel-aws-xray-starter/src/main/resources/META-INF/spring.provides b/platforms/spring-boot/components-starter/camel-aws-xray-starter/src/main/resources/META-INF/spring.provides
new file mode 100644
index 0000000..b7c3bc2
--- /dev/null
+++ b/platforms/spring-boot/components-starter/camel-aws-xray-starter/src/main/resources/META-INF/spring.provides
@@ -0,0 +1,17 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+##
+##      http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+provides: camel-aws-xray
diff --git a/platforms/spring-boot/components-starter/pom.xml b/platforms/spring-boot/components-starter/pom.xml
index e5f0a67..8ec568f 100644
--- a/platforms/spring-boot/components-starter/pom.xml
+++ b/platforms/spring-boot/components-starter/pom.xml
@@ -87,6 +87,7 @@
     <module>camel-atomix-starter</module>
     <module>camel-avro-starter</module>
     <module>camel-aws-starter</module>
+    <module>camel-aws-xray-starter</module>
     <module>camel-azure-starter</module>
     <module>camel-bam-starter</module>
     <module>camel-barcode-starter</module>

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