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:47 UTC

[camel] branch master updated (2f32a05 -> 2df9fdb)

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

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


    from 2f32a05  CAMEL-12049 - Camel-AWS: Add update function operation to AWS lambda component
     new 3dc9ae1  Added support for AWS XRay tracing of Camel's exchange routing capabilities which works similar to the OpenTracing tracer support camel-opentracing provides. This implementation differs, however, slightly from the one of OpenTracing due to the thread-local nature of an AWS XRay segment and its behavior if a new segment is created if already an existing segment is present in the context of the current thread. Upon exchange creation it is first checked whether an existing  [...]
     new a142a2e  Fixed typo in documentation
     new 0ceca02  Bumped version from 2.19.2-SNAPSHOT to 2.21.0 as requested in code-review Applied formatting guidlines according to checkstyle
     new 2cdaa43  Replaced org.json library with a self-written JSON parser due to imcompatibilities with the Apache 2.0 licence
     new b332589  Added decorator support similar to OpenTracing
     new 3590502  Improved the visualization of executed beans or prcoessors by appending the actual processed EIP separated by a colon to the actual name Added service loader provider configuration in oder for ServiceLoader to be able to find actual implementations Added a sanitizeName helper method as AWS does only allow a certain set of characters to appear within a (sub)segment name Updated some tests due to decorators now disable the tracing of i.e. .to("log:...") invocations
     new 8603524  Minor typo fix
     new 2df9fdb  Regen after AWS Xray component merge

The 8 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 components/camel-aws-xray/pom.xml                  | 101 +++++
 .../camel-aws-xray/src/main/docs/awsxray.adoc      |  93 +++++
 .../component/aws/xray/EIPTracingStrategy.java     |  60 +++
 .../component/aws/xray/NoopTracingStrategy.java    |  32 ++
 .../camel/component/aws/xray/SegmentDecorator.java |  83 +++++
 .../aws/xray/TraceAnnotatedTracingStrategy.java    |  96 +++++
 .../apache/camel/component/aws/xray/XRayTrace.java |  37 ++
 .../camel/component/aws/xray/XRayTracer.java       | 415 +++++++++++++++++++++
 .../xray/decorators/AbstractSegmentDecorator.java  | 101 +++++
 .../aws/xray/decorators/CqlSegmentDecorator.java   |  58 +++
 .../decorators/ElasticsearchSegmentDecorator.java  |  59 +++
 .../aws/xray/decorators/JdbcSegmentDecorator.java  |  41 ++
 .../aws/xray/decorators/LogSegmentDecorator.java   |  30 ++
 .../xray/decorators/MongoDBSegmentDecorator.java   |  52 +++
 .../aws/xray/decorators/SqlSegmentDecorator.java   |  43 +++
 .../aws/xray/decorators/TimerSegmentDecorator.java |  34 ++
 .../http/AbstractHttpSegmentDecorator.java         | 102 +++++
 .../xray/decorators/http/AhcSegmentDecorator.java  |  25 ++
 .../decorators/http/Http4SegmentDecorator.java     |  25 ++
 .../xray/decorators/http/HttpSegmentDecorator.java |  25 ++
 .../decorators/http/JettySegmentDecorator.java     |  25 ++
 .../http/NettyHttp4SegmentDecorator.java           |  25 ++
 .../decorators/http/NettyHttpSegmentDecorator.java |  25 ++
 .../xray/decorators/http/RestSegmentDecorator.java | 101 +++++
 .../decorators/http/RestletSegmentDecorator.java   |  25 ++
 .../decorators/http/ServletSegmentDecorator.java   |  25 ++
 .../decorators/http/UndertowSegmentDecorator.java  |  25 ++
 .../internal/AbstractInternalSegmentDecorator.java |  31 ++
 .../internal/DirectSegmentDecorator.java           |  25 ++
 .../internal/DirectvmSegmentDecorator.java         |  25 ++
 .../internal/DisruptorSegmentDecorator.java        |  25 ++
 .../internal/DisruptorvmSegmentDecorator.java      |  25 ++
 .../decorators/internal/SedaSegmentDecorator.java  |  25 ++
 .../decorators/internal/VmSegmentDecorator.java    |  25 ++
 .../AbstractMessagingSegmentDecorator.java         |  52 +++
 .../decorators/messaging/AmqpSegmentDecorator.java |  25 ++
 .../messaging/AwsSnsSegmentDecorator.java          |  34 ++
 .../messaging/AwsSqsSegmentDecorator.java          |  34 ++
 .../messaging/CometdSegmentDecorator.java          |  35 ++
 .../messaging/CometdsSegmentDecorator.java         |  25 ++
 .../messaging/IronmqSegmentDecorator.java          |  34 ++
 .../decorators/messaging/JmsSegmentDecorator.java  |  34 ++
 .../messaging/KafkaSegmentDecorator.java           |  80 ++++
 .../decorators/messaging/MqttSegmentDecorator.java |  42 +++
 .../decorators/messaging/PahoSegmentDecorator.java |  25 ++
 .../messaging/RabbitmqSegmentDecorator.java        |  38 ++
 .../decorators/messaging/SjmsSegmentDecorator.java |  25 ++
 .../messaging/StompSegmentDecorator.java           |  36 ++
 .../src/main/resources/META-INF/LICENSE.txt        |   0
 .../src/main/resources/META-INF/NOTICE.txt         |   0
 ...pache.camel.component.aws.xray.SegmentDecorator |  56 +++
 .../camel/component/aws/xray/ABCRouteTest.java     |  81 ++++
 .../camel/component/aws/xray/BeanTracingTest.java  | 107 ++++++
 .../aws/xray/CamelAwsXRayTestSupport.java          |  93 +++++
 .../aws/xray/ClientRecipientListRouteTest.java     |  66 ++++
 .../camel/component/aws/xray/EIPTracingTest.java   | 116 ++++++
 .../component/aws/xray/ErrorHandlingTest.java      | 157 ++++++++
 .../apache/camel/component/aws/xray/ErrorTest.java | 138 +++++++
 .../camel/component/aws/xray/FakeAWSDaemon.java    | 248 ++++++++++++
 .../aws/xray/MulticastParallelRouteTest.java       |  74 ++++
 .../component/aws/xray/MulticastRouteTest.java     |  75 ++++
 .../component/aws/xray/Route2ConcurrentTest.java   |  75 ++++
 .../component/aws/xray/RouteConcurrentTest.java    |  61 +++
 .../aws/xray/SpringAwsXRaySimpleRouteTest.java     |  77 ++++
 .../camel/component/aws/xray/TestDataBuilder.java  | 214 +++++++++++
 .../apache/camel/component/aws/xray/TestUtils.java | 168 +++++++++
 .../camel/component/aws/xray/TwoService2Test.java  |  60 +++
 .../camel/component/aws/xray/TwoServiceTest.java   |  60 +++
 .../aws/xray/TwoServiceWithExcludeTest.java        |  65 ++++
 .../camel/component/aws/xray/json/JsonArray.java   |  23 ++
 .../camel/component/aws/xray/json/JsonObject.java  |  93 +++++
 .../camel/component/aws/xray/json/JsonParser.java  | 154 ++++++++
 .../component/aws/xray/json/JsonStructure.java     |  22 ++
 .../camel/component/aws/xray/json/JsonTest.java    | 174 +++++++++
 .../src/test/resources/logback-test.xml            |  49 +++
 .../camel/aws/xray/AwsXRaySimpleRouteTest.xml      |  47 +++
 components/pom.xml                                 |   1 +
 components/readme.adoc                             |   4 +-
 docs/user-manual/en/SUMMARY.md                     |   1 +
 .../camel-aws-xray-starter/pom.xml                 |  61 +++
 .../src/main/resources/META-INF/LICENSE.txt        |   0
 .../src/main/resources/META-INF/NOTICE.txt         |   0
 .../src/main/resources/META-INF/spring.provides    |  17 +
 platforms/spring-boot/components-starter/pom.xml   |   1 +
 84 files changed, 5100 insertions(+), 1 deletion(-)
 create mode 100644 components/camel-aws-xray/pom.xml
 create mode 100644 components/camel-aws-xray/src/main/docs/awsxray.adoc
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/EIPTracingStrategy.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/NoopTracingStrategy.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/SegmentDecorator.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/TraceAnnotatedTracingStrategy.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/XRayTrace.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/XRayTracer.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/AbstractSegmentDecorator.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/CqlSegmentDecorator.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/ElasticsearchSegmentDecorator.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/JdbcSegmentDecorator.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/LogSegmentDecorator.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/MongoDBSegmentDecorator.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/SqlSegmentDecorator.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/TimerSegmentDecorator.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/AbstractHttpSegmentDecorator.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/AhcSegmentDecorator.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/Http4SegmentDecorator.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/HttpSegmentDecorator.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/JettySegmentDecorator.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/NettyHttp4SegmentDecorator.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/NettyHttpSegmentDecorator.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/RestSegmentDecorator.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/RestletSegmentDecorator.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/ServletSegmentDecorator.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/UndertowSegmentDecorator.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/internal/AbstractInternalSegmentDecorator.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/internal/DirectSegmentDecorator.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/internal/DirectvmSegmentDecorator.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/internal/DisruptorSegmentDecorator.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/internal/DisruptorvmSegmentDecorator.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/internal/SedaSegmentDecorator.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/internal/VmSegmentDecorator.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/AbstractMessagingSegmentDecorator.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/AmqpSegmentDecorator.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/AwsSnsSegmentDecorator.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/AwsSqsSegmentDecorator.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/CometdSegmentDecorator.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/CometdsSegmentDecorator.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/IronmqSegmentDecorator.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/JmsSegmentDecorator.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/KafkaSegmentDecorator.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/MqttSegmentDecorator.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/PahoSegmentDecorator.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/RabbitmqSegmentDecorator.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/SjmsSegmentDecorator.java
 create mode 100644 components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/StompSegmentDecorator.java
 copy {tooling/maven/guice-maven-plugin => components/camel-aws-xray}/src/main/resources/META-INF/LICENSE.txt (100%)
 copy {tooling/maven/guice-maven-plugin => components/camel-aws-xray}/src/main/resources/META-INF/NOTICE.txt (100%)
 create mode 100644 components/camel-aws-xray/src/main/resources/META-INF/services/org.apache.camel.component.aws.xray.SegmentDecorator
 create mode 100644 components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/ABCRouteTest.java
 create mode 100644 components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/BeanTracingTest.java
 create mode 100644 components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/CamelAwsXRayTestSupport.java
 create mode 100644 components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/ClientRecipientListRouteTest.java
 create mode 100644 components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/EIPTracingTest.java
 create mode 100644 components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/ErrorHandlingTest.java
 create mode 100644 components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/ErrorTest.java
 create mode 100644 components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/FakeAWSDaemon.java
 create mode 100644 components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/MulticastParallelRouteTest.java
 create mode 100644 components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/MulticastRouteTest.java
 create mode 100644 components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/Route2ConcurrentTest.java
 create mode 100644 components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/RouteConcurrentTest.java
 create mode 100644 components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/SpringAwsXRaySimpleRouteTest.java
 create mode 100644 components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/TestDataBuilder.java
 create mode 100644 components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/TestUtils.java
 create mode 100644 components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/TwoService2Test.java
 create mode 100644 components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/TwoServiceTest.java
 create mode 100644 components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/TwoServiceWithExcludeTest.java
 create mode 100644 components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/json/JsonArray.java
 create mode 100644 components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/json/JsonObject.java
 create mode 100644 components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/json/JsonParser.java
 create mode 100644 components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/json/JsonStructure.java
 create mode 100644 components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/json/JsonTest.java
 create mode 100644 components/camel-aws-xray/src/test/resources/logback-test.xml
 create mode 100644 components/camel-aws-xray/src/test/resources/org/apache/camel/aws/xray/AwsXRaySimpleRouteTest.xml
 create mode 100644 platforms/spring-boot/components-starter/camel-aws-xray-starter/pom.xml
 copy {tooling/maven/guice-maven-plugin => platforms/spring-boot/components-starter/camel-aws-xray-starter}/src/main/resources/META-INF/LICENSE.txt (100%)
 copy {tooling/maven/guice-maven-plugin => platforms/spring-boot/components-starter/camel-aws-xray-starter}/src/main/resources/META-INF/NOTICE.txt (100%)
 create mode 100644 platforms/spring-boot/components-starter/camel-aws-xray-starter/src/main/resources/META-INF/spring.provides

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

[camel] 01/08: Added support for AWS XRay tracing of Camel's exchange routing capabilities which works similar to the OpenTracing tracer support camel-opentracing provides. This implementation differs, however, slightly from the one of OpenTracing due to the thread-local nature of an AWS XRay segment and its behavior if a new segment is created if already an existing segment is present in the context of the current thread. Upon exchange creation it is first checked whether an existing segment is already [...]

Posted by ac...@apache.org.
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 3dc9ae1929d9078e6c9cf7beb215ddbee4c478c0
Author: Roman Vottner <ro...@gmx.at>
AuthorDate: Tue Oct 31 11:44:13 2017 +0100

    Added support for AWS XRay tracing of Camel's exchange routing capabilities which works similar to the OpenTracing tracer support camel-opentracing provides. This implementation differs, however, slightly from the one of OpenTracing due to the thread-local nature of an AWS XRay segment and its behavior if a new segment is created if already an existing segment is present in the context of the current thread. Upon exchange creation it is first checked whether an existing segment is alr [...]
    
    By default no tracing strategy (= InterceptStragegy) is applied though a tracing subsegment can be created on utilizing EIPTracingStrategy. If only @XRayTrace annotated beans and processors (which keep the actual business logic in it in our case) should be tracked TraceAnnotatedTracingStrategy can be used instead.
---
 components/camel-aws-xray/pom.xml                  | 101 ++++++
 .../camel-aws-xray/src/main/docs/awsxray.adoc      |  93 ++++++
 .../component/aws/xray/EIPTracingStrategy.java     |  58 ++++
 .../component/aws/xray/NoopTracingStrategy.java    |  32 ++
 .../aws/xray/TraceAnnotatedTracingStrategy.java    |  93 ++++++
 .../apache/camel/component/aws/xray/XRayTrace.java |  37 +++
 .../camel/component/aws/xray/XRayTracer.java       | 351 +++++++++++++++++++++
 .../camel/component/aws/xray/ABCRouteTest.java     |  80 +++++
 .../camel/component/aws/xray/BeanTracingTest.java  | 107 +++++++
 .../aws/xray/CamelAwsXRayTestSupport.java          |  93 ++++++
 .../aws/xray/ClientRecipientListRouteTest.java     |  66 ++++
 .../camel/component/aws/xray/EIPTracingTest.java   | 116 +++++++
 .../component/aws/xray/ErrorHandlingTest.java      | 156 +++++++++
 .../apache/camel/component/aws/xray/ErrorTest.java | 138 ++++++++
 .../camel/component/aws/xray/FakeAWSDaemon.java    | 251 +++++++++++++++
 .../aws/xray/MulticastParallelRouteTest.java       |  73 +++++
 .../component/aws/xray/MulticastRouteTest.java     |  74 +++++
 .../component/aws/xray/Route2ConcurrentTest.java   |  75 +++++
 .../component/aws/xray/RouteConcurrentTest.java    |  61 ++++
 .../aws/xray/SpringAwsXRaySimpleRouteTest.java     |  77 +++++
 .../camel/component/aws/xray/TestDataBuilder.java  | 210 ++++++++++++
 .../apache/camel/component/aws/xray/TestUtils.java | 161 ++++++++++
 .../camel/component/aws/xray/TwoService2Test.java  |  60 ++++
 .../camel/component/aws/xray/TwoServiceTest.java   |  60 ++++
 .../aws/xray/TwoServiceWithExcludeTest.java        |  65 ++++
 .../src/test/resources/logback-test.xml            |  47 +++
 .../AwsXRaySimpleRouteTest.xml                     |  45 +++
 components/pom.xml                                 |   1 +
 28 files changed, 2781 insertions(+)

diff --git a/components/camel-aws-xray/pom.xml b/components/camel-aws-xray/pom.xml
new file mode 100644
index 0000000..9fe4377
--- /dev/null
+++ b/components/camel-aws-xray/pom.xml
@@ -0,0 +1,101 @@
+<?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/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <artifactId>components</artifactId>
+    <groupId>org.apache.camel</groupId>
+    <version>2.19.2-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>camel-aws-xray</artifactId>
+  <packaging>jar</packaging>
+
+  <name>Camel :: AWS :: XRay</name>
+  <description>Distributed tracing using AWS XRay</description>
+
+  <properties>
+    <aws-xray.version>1.2.0</aws-xray.version>
+    <firstVersion>2.19.2</firstVersion>
+    <label>monitoring,microservice</label>
+    <title>XRay</title>
+
+    <camel.osgi.export.pkg>org.apache.camel.aws-xray.*</camel.osgi.export.pkg>
+  </properties>
+
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>com.amazonaws</groupId>
+        <artifactId>aws-xray-recorder-sdk-bom</artifactId>
+        <version>${aws-xray.version}</version>
+        <type>pom</type>
+        <scope>import</scope>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+
+  <dependencies>
+
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-core</artifactId>
+    </dependency>
+
+    <!-- AWS XRay -->
+    <dependency>
+      <!-- Basic functionality for creating segments and transmitting segments. Includes
+           AWSXRayServletFilter for instrumenting incoming requests -->
+      <groupId>com.amazonaws</groupId>
+      <artifactId>aws-xray-recorder-sdk-core</artifactId>
+    </dependency>
+    <dependency>
+      <!-- Instruments calls to AWS services made with AWS SDK for Java clients by adding a tracing
+           client as a request handler -->
+      <groupId>com.amazonaws</groupId>
+      <artifactId>aws-xray-recorder-sdk-aws-sdk</artifactId>
+    </dependency>
+    <dependency>
+      <!-- Instruments outbound HTTP calls made with Apache HTTP clients -->
+      <groupId>com.amazonaws</groupId>
+      <artifactId>aws-xray-recorder-sdk-apache-http</artifactId>
+    </dependency>
+
+    <!-- test dependencies -->
+    <dependency>
+      <groupId>org.hamcrest</groupId>
+      <artifactId>hamcrest-all</artifactId>
+      <version>1.3</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-test-spring</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.json</groupId>
+      <artifactId>json</artifactId>
+      <version>20170516</version>
+      <scope>test</scope>
+    </dependency>
+
+  </dependencies>
+</project>
\ No newline at end of file
diff --git a/components/camel-aws-xray/src/main/docs/awsxray.adoc b/components/camel-aws-xray/src/main/docs/awsxray.adoc
new file mode 100644
index 0000000..ffae7aa
--- /dev/null
+++ b/components/camel-aws-xray/src/main/docs/awsxray.adoc
@@ -0,0 +1,93 @@
+[[AWSXRay-AWSXRayComponent]]
+## AWS XRay Component
+
+*Available as of Camel 2.20*
+
+The camel-aws-xray component is used for tracing and timing incoming and outgoing Camel messages using https://aws.amazon.com/de/xray/[AWS XRay].
+
+Events (subsegments) are captured for incoming and outgoing messages being sent to/from Camel.
+
+### Dependency
+
+In order to include AWS XRay support into Camel, the archive containing the Camel related AWS XRay related classes need to be added to the project. In addition to that, AWS XRay libraries also need to be available.
+
+To include both, AWS XRay and Camel, dependencies use the following Maven imports:
+
+[source,xml]
+---------------------------------------------------------------------------------------------------------
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>com.amazonaws</groupId>
+        <artifactId>aws-xray-recorder-sdk-bom</artifactId>
+        <version>1.2.0</version>
+        <type>pom</type>
+        <scope>import</scope>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+
+  <dependencies>
+      <dependency>
+        <groupId>org.apache.camel</groupId>
+        <artifactId>camel-aws.xray</artifactId>
+      </dependency>
+
+      <dependency>
+        <groupId>com.amazonaws</groupId>
+        <artifactId>aws-xray-recorder-sdk-core</artifactId>
+      </dependency>
+      <dependency>
+        <groupId>com.amazonaws</groupId>
+        <artifactId>aws-xray-recorder-sdk-aws-sdk</artifactId>
+      </dependency>
+  <dependencies>
+---------------------------------------------------------------------------------------------------------
+
+### Configuration
+
+The configuration properties for the AWS XRay tracer are:
+
+[width="100%",cols="10%,10%,80%",options="header",]
+|=======================================================================
+|Option |Default |Description
+
+|excludePatterns |  | Sets exclude pattern(s) that will disable tracing for Camel
+messages that matches the pattern. The content is a Set<String> where the key is a pattern matching routeId's. The pattern
+uses the rules from link:intercept.html[Intercept].
+
+|=======================================================================
+
+There is currently only one way an AWS XRay tracer can be configured to provide distributed tracing for a Camel application:
+
+#### Explicit
+
+Include the `camel-aws-xray` component in your POM, along with any specific dependencies associated with the AWS XRay Tracer.
+
+To explicitly configure AWS XRay support, instantiate the `XRayTracer` and initialize the camel
+context. You can optionally specify a `Tracer`, or alternatively it can be implicitly discovered using the
+`Registry` or `ServiceLoader`.
+
+[source,java]
+--------------------------------------------------------------------------------------------------
+XRayTracer xrayTracer = new XRayTracer();
+// By default it uses a NoopTracingStrategy, but you can override it with a specific InterceptStrategy implementation.
+xrayTracer.setTracingStrategy(...);
+// And then initialize the context
+xrayTracer.init(camelContext);
+--------------------------------------------------------------------------------------------------
+
+To use XRayTracer in XML, all you need to do is to define the
+AWS XRay tracer bean. Camel will automatically discover and use it.
+
+[source,xml]
+---------------------------------------------------------------------------------------------------------
+  <bean id="tracingStrategy" class="..."/>
+  <bean id="aws-xray-tracer" class="org.apache.camel.component.aws.xray.XRayTracer" />
+    <property name="tracer" ref="tracingStrategy"/>
+  </bean>
+---------------------------------------------------------------------------------------------------------
+
+### Example
+
+You can find an example demonstrating the way to configure AWS XRay tracing within the tests accompanying this project.
\ No newline at end of file
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
new file mode 100644
index 0000000..c91cdf8
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/EIPTracingStrategy.java
@@ -0,0 +1,58 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray;
+
+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;
+import org.apache.camel.model.ProcessorDefinition;
+import org.apache.camel.processor.DelegateAsyncProcessor;
+import org.apache.camel.spi.InterceptStrategy;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class EIPTracingStrategy implements InterceptStrategy {
+
+    private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
+    @Override
+    public Processor wrapProcessorInInterceptors(CamelContext camelContext,
+        ProcessorDefinition<?> processorDefinition, Processor target, Processor nextTarget)
+        throws Exception {
+
+        String defName = processorDefinition.getShortName();
+
+        return new DelegateAsyncProcessor((Exchange exchange) -> {
+            LOG.trace("Creating new subsegment for {} - EIP {}", defName, target);
+            Subsegment subsegment = AWSXRay.beginSubsegment(defName);
+            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 {}", defName);
+                subsegment.close();
+            }
+        });
+    }
+}
\ No newline at end of file
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/NoopTracingStrategy.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/NoopTracingStrategy.java
new file mode 100644
index 0000000..90f5b9c
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/NoopTracingStrategy.java
@@ -0,0 +1,32 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.Processor;
+import org.apache.camel.model.ProcessorDefinition;
+import org.apache.camel.processor.DelegateAsyncProcessor;
+import org.apache.camel.spi.InterceptStrategy;
+
+public class NoopTracingStrategy implements InterceptStrategy {
+
+    @Override
+    public Processor wrapProcessorInInterceptors(CamelContext camelContext, ProcessorDefinition<?> processorDefinition,
+                                                 Processor target, Processor nextTarget) throws Exception {
+        return new DelegateAsyncProcessor(target);
+    }
+}
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
new file mode 100644
index 0000000..a8a7491
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/TraceAnnotatedTracingStrategy.java
@@ -0,0 +1,93 @@
+/**
+ * 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.
+ */
+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 org.apache.camel.CamelContext;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.component.bean.BeanProcessor;
+import org.apache.camel.model.BeanDefinition;
+import org.apache.camel.model.ProcessDefinition;
+import org.apache.camel.model.ProcessorDefinition;
+import org.apache.camel.processor.DelegateAsyncProcessor;
+import org.apache.camel.processor.DelegateSyncProcessor;
+import org.apache.camel.spi.InterceptStrategy;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class TraceAnnotatedTracingStrategy implements InterceptStrategy {
+
+  private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
+  @Override
+  public Processor wrapProcessorInInterceptors(CamelContext camelContext,
+      ProcessorDefinition<?> processorDefinition,
+      Processor target, Processor nextTarget)
+      throws Exception {
+
+    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 (!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);
+
+    Annotation annotation = processorClass.getAnnotation(XRayTrace.class);
+    XRayTrace trace = (XRayTrace)annotation;
+
+    String metricName = trace.metricName();
+
+    if ("".equals(metricName)) {
+      metricName = processorClass.getSimpleName();
+    }
+
+    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();
+      }
+    });
+  }
+}
\ 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
new file mode 100644
index 0000000..8a05857
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/XRayTrace.java
@@ -0,0 +1,37 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Annotates a class for being a target for tracing via Camel's AWS XRay tracer. The target class
+ * has thus to be either a Camel {@link org.apache.camel.Processor Processor} or a
+ * <code>.bean(...)</code> invoked class.
+ * <p/>
+ * 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 })
+@Retention(RetentionPolicy.RUNTIME)
+public @interface XRayTrace {
+
+  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
new file mode 100644
index 0000000..f213b10
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/XRayTracer.java
@@ -0,0 +1,351 @@
+/**
+ * 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.
+ */
+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 org.apache.camel.CamelContext;
+import org.apache.camel.CamelContextAware;
+import org.apache.camel.Exchange;
+import org.apache.camel.Route;
+import org.apache.camel.StaticService;
+import org.apache.camel.management.event.ExchangeSendingEvent;
+import org.apache.camel.management.event.ExchangeSentEvent;
+import org.apache.camel.model.RouteDefinition;
+import org.apache.camel.spi.InterceptStrategy;
+import org.apache.camel.spi.RoutePolicy;
+import org.apache.camel.spi.RoutePolicyFactory;
+import org.apache.camel.support.EventNotifierSupport;
+import org.apache.camel.support.RoutePolicySupport;
+import org.apache.camel.support.ServiceSupport;
+import org.apache.camel.util.ObjectHelper;
+import org.apache.camel.util.ServiceHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * To use AWS XRay with Camel setup this {@link XRayTracer} in your Camel application.
+ * <p/>
+ * This class uses a {@link org.apache.camel.spi.RoutePolicy} as well as a {@link
+ * org.apache.camel.spi.EventNotifier} internally to manage the creation and termination of AWS XRay
+ * {@link Segment Segments} and {@link Subsegment Subsegments} once an exchange was created,
+ * forwarded or closed in order to allow monitoring the lifetime metrics of the exchange.
+ * <p/>
+ * A {@link InterceptStrategy} is used in order to track invocations and durations of EIP patterns
+ * used in processed routes. If no strategy is passed while configuration via {@link
+ * #setTracingStrategy(InterceptStrategy)}, a {@link NoopTracingStrategy} will be used by default
+ * which will not monitor any invocations at all.
+ * <p/>
+ * By default every invoked route will be tracked by AWS XRay. If certain routes shell not be
+ * tracked {@link #addExcludePattern(String)} and {@link #setExcludePatterns(Set)} can be used to
+ * provide the <em>routeId</em> of the routes to exclude from monitoring.
+ */
+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";
+    /** Exchange property for passing a segment between threads **/
+    private static final String CURRENT_SEGMENT = "CAMEL_PROPERTY_AWS_XRAY_CURRENT_SEGMENT";
+
+    private final XRayEventNotifier eventNotifier = new XRayEventNotifier();
+    private CamelContext camelContext;
+
+    private Set<String> excludePatterns = new HashSet<>();
+    private InterceptStrategy tracingStrategy;
+
+    @Override
+    public void setCamelContext(CamelContext camelContext) {
+        this.camelContext = camelContext;
+    }
+
+    @Override
+    public CamelContext getCamelContext() {
+        return this.camelContext;
+    }
+
+    @Override
+    public RoutePolicy createRoutePolicy(CamelContext camelContext, String routeId, RouteDefinition route) {
+        init(camelContext);
+        return new XRayRoutePolicy(routeId);
+    }
+
+    @Override
+    protected void doStart() throws Exception {
+        ObjectHelper.notNull(camelContext, "CamelContext", this);
+
+        camelContext.getManagementStrategy().addEventNotifier(eventNotifier);
+        if (!camelContext.getRoutePolicyFactories().contains(this)) {
+            camelContext.addRoutePolicyFactory(this);
+        }
+
+        if (null == tracingStrategy) {
+            LOG.info("No tracing strategy available. Defaulting to no-op strategy");
+            tracingStrategy = new NoopTracingStrategy();
+        }
+
+        camelContext.addInterceptStrategy(tracingStrategy);
+
+        LOG.debug("Starting XRay tracer");
+    }
+
+    @Override
+    protected void doStop() throws Exception {
+        // stop event notifier
+        camelContext.getManagementStrategy().removeEventNotifier(eventNotifier);
+        ServiceHelper.stopAndShutdownService(eventNotifier);
+
+        camelContext.getRoutePolicyFactories().remove(this);
+        LOG.debug("XRay tracer stopped");
+    }
+
+    /**
+     * Initializes this AWS XRay tracer implementation as service within the Camel environment.
+     *
+     * @param camelContext The context to register this tracer as service with
+     */
+    public void init(CamelContext camelContext) {
+        if (!camelContext.hasService(this)) {
+            try {
+                LOG.debug("Initializing XRay tracer");
+                // start this service eager so we init before Camel is starting up
+                camelContext.addService(this, true, true);
+            } catch (Exception e) {
+                throw ObjectHelper.wrapRuntimeCamelException(e);
+            }
+        }
+    }
+
+    /**
+     * Returns the currently used tracing strategy which is responsible for tracking invoked EIP or
+     * beans.
+     *
+     * @return The currently used tracing strategy
+     */
+    public InterceptStrategy getTracingStrategy() {
+        return tracingStrategy;
+    }
+
+    /**
+     * Specifies the instance responsible for tracking invoked EIP and beans with AWS XRay.
+     *
+     * @param traceingStrategy The instance which tracks invoked EIP and beans
+     */
+    public void setTracingStrategy(InterceptStrategy traceingStrategy) {
+        this.tracingStrategy = traceingStrategy;
+    }
+
+    /**
+     * Returns the set of currently excluded routes. Any route ID specified in the returned set will
+     * not be monitored by this AWS XRay tracer implementation.
+     *
+     * @return The IDs of the currently excluded routes for which no tracking will be performed
+     */
+    public Set<String> getExcludePatterns() {
+        return this.excludePatterns;
+    }
+
+    /**
+     * Excludes all of the routes matching any of the contained routeIds within the given argument
+     * from tracking by this tracer implementation. Excluded routes will not appear within the AWS
+     * XRay monitoring.
+     *
+     * @param excludePatterns A set of routeIds which should not be tracked by this tracer
+     */
+    public void setExcludePatterns(Set<String> excludePatterns) {
+        this.excludePatterns = excludePatterns;
+    }
+
+    /**
+     * Adds an exclude pattern that will disable tracing for Camel messages that matches the pattern.
+     *
+     * @param pattern The pattern such as route id, endpoint url
+     */
+    public void addExcludePattern(String pattern) {
+        excludePatterns.add(pattern);
+    }
+
+    private boolean isExcluded(String routeId) {
+        // check for a defined routeId
+        if (!excludePatterns.isEmpty()) {
+            for (String pattern : excludePatterns) {
+                if (pattern.equals(routeId)) {
+                    LOG.debug("Ignoring route with ID {}", routeId);
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
+    /**
+     * Custom camel event handler that will create a new {@link Subsegment XRay subsegment} in case
+     * the current exchange is forwarded via <code>.to(someEndpoint)</code> to some endpoint and
+     * accordingly closes the subsegment if the execution returns.
+     * <p/>
+     * Note that AWS XRay is designed to manage {@link Segment segments} and {@link Subsegment
+     * subsegments} within a {@link ThreadLocal} context. Forwarding the exchange to a <em>SEDA</em>
+     * endpoint will thus copy over the exchange to a new thread, though any available segment
+     * information collected by AWS XRay will not be available within that new thread!
+     * <p/>
+     * As  {@link ExchangeSendingEvent} and {@link ExchangeSentEvent} both are executed within the
+     * invoking thread (in contrast to {@link org.apache.camel.management.event.ExchangeCreatedEvent
+     * ExchangeCreatedEvent} and {@link org.apache.camel.management.event.ExchangeCompletedEvent
+     * ExchangeCompletedEvent} which both run in the context of the spawned thread), adding further
+     * subsegments by this {@link org.apache.camel.spi.EventNotifier EventNotifier} implementation
+     * should be safe.
+     */
+    private final class XRayEventNotifier extends EventNotifierSupport {
+
+        @Override
+        public void notify(EventObject event) throws Exception {
+
+            if (event instanceof ExchangeSendingEvent) {
+                ExchangeSendingEvent ese = (ExchangeSendingEvent) event;
+                LOG.trace("-> {} - target: {} (routeId: {})",
+                    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);
+                    LOG.trace("Copying over segment {}/{} from exchange received from {} to exchange processing {}",
+                        segment.getId(), segment.getName(), ese.getExchange().getFromEndpoint(),
+                        ese.getEndpoint());
+                    AWSXRay.setTraceEntity(segment);
+                }
+
+                if (AWSXRay.getCurrentSegmentOptional().isPresent()) {
+                    String endpointName = ese.getEndpoint().getEndpointKey();
+                    // AWS XRay does only allow a certain set of characters to appear within a name
+                    // Allowed characters: a-z, A-Z, 0-9, _, ., :, /, %, &, #, =, +, \, -, @
+                    endpointName = endpointName.replaceAll("://", "_");
+                    endpointName = endpointName.replaceAll("\\?", "&");
+                    Subsegment subsegment = AWSXRay.beginSubsegment("SendingTo_" + endpointName);
+                    LOG.trace("Creating new subsegment with ID {} and name {}",
+                        subsegment.getId(), subsegment.getName());
+                } else {
+                    LOG.trace("Ignoring creation of XRay subsegment as no segment exists in the current thread");
+                }
+
+            } else if (event instanceof ExchangeSentEvent) {
+                ExchangeSentEvent ese = (ExchangeSentEvent) event;
+                LOG.trace("-> {} - target: {} (routeId: {})",
+                    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());
+                }
+            } else {
+                LOG.trace("Received event {} from source {}", event, event.getSource());
+            }
+        }
+
+        @Override
+        public boolean isEnabled(EventObject event) {
+            // listen for either when an exchange invoked an other endpoint
+            return event instanceof ExchangeSendingEvent
+                || event instanceof ExchangeSentEvent;
+        }
+    }
+
+    /**
+     * A custom {@link org.apache.camel.spi.RoutePolicy RoutePolicy} implementation that will create
+     * a new AWS XRay {@link Segment} once a new exchange is being created and the current thread
+     * does not know of an active segment yet. In case the exchange was forwarded within the same
+     * thread (i.e. by forwarding to a direct endpoint via <code>.to("direct:...)</code>) and a
+     * previous exchange already created a {@link Segment} this policy will add a new {@link
+     * Subsegment} for the created exchange to the trace.
+     * <p/>
+     * This policy will also manage the termination of created {@link Segment Segments} and {@link
+     * Subsegment Subsegments}.
+     * <p/>
+     * As AWS XRay is designed to manage {@link Segment Segments} in a {@link ThreadLocal} context
+     * this policy will create a new segment for each forward to a new thread i.e. by sending the
+     * exchange to a <em>SEDA</em> endpoint.
+     */
+    private final class XRayRoutePolicy extends RoutePolicySupport {
+
+        private String routeId;
+
+        XRayRoutePolicy(String routeId) {
+            this.routeId = routeId;
+        }
+
+        @Override
+        public void onExchangeBegin(Route route, Exchange exchange) {
+            // kicks in after a seda-thread was created. The new thread has the control
+            if (isExcluded(route.getId())) {
+                return;
+            }
+
+            LOG.trace("=> RoutePolicy-Begin: Route: {} - RouteId: {}", routeId, route.getId());
+
+            TraceID traceID;
+            if (exchange.getIn().getHeaders().containsKey(XRAY_TRACE_ID)) {
+                traceID = TraceID.fromString(exchange.getIn().getHeader(XRAY_TRACE_ID, String.class));
+            } else {
+                traceID = new TraceID();
+                exchange.getIn().setHeader(XRAY_TRACE_ID, traceID.toString());
+            }
+
+            if (!AWSXRay.getCurrentSegmentOptional().isPresent()) {
+                Segment segment = AWSXRay.beginSegment(route.getId());
+                segment.setTraceId(traceID);
+                LOG.trace("Created new XRay segment {} with name {}",
+                    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());
+            }
+        }
+
+        @Override
+        public void onExchangeDone(Route route, Exchange exchange) {
+            // kicks in before the seda-thread is terminated. Control is still in the seda-thread
+            if (isExcluded(route.getId())) {
+                return;
+            }
+
+            LOG.trace("=> RoutePolicy-Done: Route: {} - RouteId: {}", routeId, route.getId());
+
+            if (AWSXRay.getCurrentSubsegmentOptional().isPresent()) {
+                Subsegment subsegment = AWSXRay.getCurrentSubsegment();
+                subsegment.close();
+                LOG.trace("Closing down Subsegment {} with name {}",
+                    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());
+            }
+        }
+    }
+}
\ No newline at end of file
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
new file mode 100644
index 0000000..713a58db
--- /dev/null
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/ABCRouteTest.java
@@ -0,0 +1,80 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray;
+
+import org.apache.camel.builder.RouteBuilder;
+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"))
+                    )
+                )
+            )
+            .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");
+
+    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");
+
+        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: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)}"));
+      }
+    };
+  }
+}
\ 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
new file mode 100644
index 0000000..943e545
--- /dev/null
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/BeanTracingTest.java
@@ -0,0 +1,107 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray;
+
+import com.amazonaws.xray.AWSXRay;
+import org.apache.camel.Body;
+import org.apache.camel.Exchange;
+import org.apache.camel.Handler;
+import org.apache.camel.Processor;
+import org.apache.camel.RoutesBuilder;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.spi.InterceptStrategy;
+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"))
+            )
+    );
+  }
+
+  @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");
+
+    template.requestBody("direct:start", "Hello");
+
+    mockEndpoint.assertIsSatisfied();
+
+    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");
+
+        from("seda:otherRoute").routeId("otherRoute")
+            .log("otherRoute has been called")
+            .process(new CustomProcessor())
+            .delay(simple("${random(0,500)}"));
+      }
+    };
+  }
+
+  @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;
+    }
+  }
+
+  @XRayTrace(metricName = "processor")
+  public static class CustomProcessor implements Processor {
+
+    @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
new file mode 100644
index 0000000..0cafc0a
--- /dev/null
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/CamelAwsXRayTestSupport.java
@@ -0,0 +1,93 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray;
+
+import java.util.Arrays;
+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;
+import org.apache.camel.processor.interceptor.Tracer;
+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();
+
+  public CamelAwsXRayTestSupport(TestTrace... testData) {
+    this.testData = Arrays.asList(testData);
+  }
+
+  @Override
+  protected void postProcessTest() throws Exception {
+    super.postProcessTest();
+    socketListener.getReceivedData().clear();
+  }
+
+  @Override
+  protected void resetMocks() {
+    super.resetMocks();
+  }
+
+  @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);
+
+    XRayTracer xRayTracer = new XRayTracer();
+    xRayTracer.setCamelContext(context);
+    xRayTracer.setTracingStrategy(getTracingStrategy());
+    xRayTracer.setExcludePatterns(getExcludePatterns());
+
+    xRayTracer.init(context);
+
+    return context;
+  }
+
+  protected InterceptStrategy getTracingStrategy() {
+    return new NoopTracingStrategy();
+  }
+
+  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
+    }
+    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
new file mode 100644
index 0000000..225602c
--- /dev/null
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/ClientRecipientListRouteTest.java
@@ -0,0 +1,66 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray;
+
+import org.apache.camel.builder.RouteBuilder;
+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"))
+    );
+  }
+
+  @Test
+  public void testRoute() throws Exception {
+    template.requestBody("direct:start", "Hello");
+
+    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"));
+
+        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: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
new file mode 100644
index 0000000..4b6ad69
--- /dev/null
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/EIPTracingTest.java
@@ -0,0 +1,116 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray;
+
+import com.amazonaws.xray.AWSXRay;
+import org.apache.camel.Body;
+import org.apache.camel.Exchange;
+import org.apache.camel.Handler;
+import org.apache.camel.Processor;
+import org.apache.camel.RoutesBuilder;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.spi.InterceptStrategy;
+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"))
+                    )
+                )
+                .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();
+  }
+
+  @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");
+
+    mockEndpoint.assertIsSatisfied();
+
+    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");
+
+        from("seda:otherRoute").routeId("otherRoute")
+            .log("otherRoute has been called")
+            .process(new CustomProcessor())
+            .delay(simple("${random(0,500)}"));
+      }
+    };
+  }
+
+  @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;
+    }
+  }
+
+  @XRayTrace(metricName = "processor")
+  public static class CustomProcessor implements Processor {
+
+    @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
new file mode 100644
index 0000000..dd57dd8
--- /dev/null
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/ErrorHandlingTest.java
@@ -0,0 +1,156 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray;
+
+import java.lang.invoke.MethodHandles;
+import org.apache.camel.Body;
+import org.apache.camel.Exchange;
+import org.apache.camel.Handler;
+import org.apache.camel.LoggingLevel;
+import org.apache.camel.Processor;
+import org.apache.camel.RoutesBuilder;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.spi.InterceptStrategy;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ErrorHandlingTest 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 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;
+    }
+
+    @Override
+    public String toString() {
+      return "TraceBean";
+    }
+  }
+
+  @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/ErrorTest.java b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/ErrorTest.java
new file mode 100644
index 0000000..b7d625d
--- /dev/null
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/ErrorTest.java
@@ -0,0 +1,138 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray;
+
+import java.lang.invoke.MethodHandles;
+import org.apache.camel.Body;
+import org.apache.camel.Exchange;
+import org.apache.camel.Handler;
+import org.apache.camel.LoggingLevel;
+import org.apache.camel.Processor;
+import org.apache.camel.RoutesBuilder;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.spi.InterceptStrategy;
+import org.junit.Test;
+import org.slf4j.Logger;
+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");
+    }
+
+    @Override
+    public String toString() {
+      return "TraceBean";
+    }
+  }
+
+  @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
new file mode 100644
index 0000000..f94951b
--- /dev/null
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/FakeAWSDaemon.java
@@ -0,0 +1,251 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray;
+
+import java.lang.invoke.MethodHandles;
+import java.net.DatagramPacket;
+import java.net.DatagramSocket;
+import java.net.SocketException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+import org.apache.camel.component.aws.xray.TestDataBuilder.TestEntity;
+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 org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+import org.junit.rules.ExternalResource;
+import org.slf4j.Logger;
+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 UDPSocketListener(Map<String, TestTrace> receivedTraces) {
+      this.receivedTraces = receivedTraces;
+    }
+
+    @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);
+                }
+                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 (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;
+    }
+
+    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 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;
+    }
+
+    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));
+        }
+      }
+    }
+
+    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
new file mode 100644
index 0000000..d0b7e00
--- /dev/null
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/MulticastParallelRouteTest.java
@@ -0,0 +1,73 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray;
+
+import org.apache.camel.builder.RouteBuilder;
+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"))
+            )
+    );
+  }
+
+  @Test
+  public void testRoute() throws Exception {
+    template.requestBody("direct:start", "Hello");
+
+    verify();
+  }
+
+  @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: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)}"));
+      }
+    };
+  }
+}
\ 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
new file mode 100644
index 0000000..e80261f
--- /dev/null
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/MulticastRouteTest.java
@@ -0,0 +1,74 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray;
+
+import org.apache.camel.builder.RouteBuilder;
+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"))
+            )
+    );
+  }
+
+  @Test
+  public void testRoute() throws Exception {
+    template.requestBody("direct:start", "Hello");
+
+    verify();
+  }
+
+  @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: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)}"));
+      }
+    };
+  }
+}
\ 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
new file mode 100644
index 0000000..906ce12
--- /dev/null
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/Route2ConcurrentTest.java
@@ -0,0 +1,75 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray;
+
+import java.util.concurrent.TimeUnit;
+import org.apache.camel.builder.NotifyBuilder;
+import org.apache.camel.builder.RouteBuilder;
+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"))
+    );
+  }
+
+  @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");
+    }
+
+    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/RouteConcurrentTest.java b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/RouteConcurrentTest.java
new file mode 100644
index 0000000..209977f
--- /dev/null
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/RouteConcurrentTest.java
@@ -0,0 +1,61 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray;
+
+import java.util.concurrent.TimeUnit;
+import org.apache.camel.builder.NotifyBuilder;
+import org.apache.camel.builder.RouteBuilder;
+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)}"));
+      }
+    };
+  }
+}
\ 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
new file mode 100644
index 0000000..95ee026
--- /dev/null
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/SpringAwsXRaySimpleRouteTest.java
@@ -0,0 +1,77 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import org.apache.camel.builder.NotifyBuilder;
+import org.apache.camel.component.aws.xray.TestDataBuilder.TestTrace;
+import org.apache.camel.test.spring.CamelSpringTestSupport;
+import org.junit.Rule;
+import org.junit.Test;
+import org.springframework.context.support.AbstractApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+public class SpringAwsXRaySimpleRouteTest extends CamelSpringTestSupport {
+
+  @Rule
+  public FakeAWSDaemon socketListener = new FakeAWSDaemon();
+
+  @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();
+
+    for (int i = 0; i < 5; i++) {
+      template.sendBody("seda:dude", "Hello World");
+    }
+
+    assertTrue(notify.matches(30, TimeUnit.SECONDS));
+
+    List<TestTrace> testData = Arrays.asList(
+        TestDataBuilder.createTrace()
+            .withSegment(TestDataBuilder.createSegment("dude")
+                .withSubsegment(TestDataBuilder.createSubsegment("car"))
+            ),
+        TestDataBuilder.createTrace()
+            .withSegment(TestDataBuilder.createSegment("dude")
+                .withSubsegment(TestDataBuilder.createSubsegment("car"))
+            ),
+        TestDataBuilder.createTrace()
+            .withSegment(TestDataBuilder.createSegment("dude")
+                .withSubsegment(TestDataBuilder.createSubsegment("car"))
+            ),
+        TestDataBuilder.createTrace()
+            .withSegment(TestDataBuilder.createSegment("dude")
+                .withSubsegment(TestDataBuilder.createSubsegment("car"))
+            ),
+        TestDataBuilder.createTrace()
+            .withSegment(TestDataBuilder.createSegment("dude")
+                .withSubsegment(TestDataBuilder.createSubsegment("car"))
+            )
+    );
+
+    Thread.sleep(2000);
+
+    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
new file mode 100644
index 0000000..badd327
--- /dev/null
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/TestDataBuilder.java
@@ -0,0 +1,210 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+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;
+    }
+
+    public Set<TestSegment> getSegments() {
+      return segments;
+    }
+
+    public TestTrace inRandomOrder() {
+      randomOrder = true;
+      return this;
+    }
+
+    public boolean isRandomOrder() {
+      return randomOrder;
+    }
+  }
+
+  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;
+
+    protected TestEntity(String name) {
+      this.name = name;
+    }
+
+    public String getName() {
+      return name;
+    }
+
+    public Map<String, Object> getAnnotations() {
+      return this.annotations;
+    }
+
+    public Map<String, Map<String, Object>> getMetadata() {
+      return metadata;
+    }
+
+    public List<TestSubsegment> getSubsegments() {
+      return subsegments;
+    }
+
+    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);
+    }
+
+    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 T withSubsegment(TestSubsegment subsegment) {
+      this.subsegments.add(subsegment);
+      return (T)this;
+    }
+
+    public T inRandomOrder() {
+      this.randomOrder = true;
+      return (T)this;
+    }
+
+    public boolean isRandomOrder() {
+      return randomOrder;
+    }
+
+    @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;
+    }
+  }
+
+  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> {
+
+    public TestSubsegment(String name) {
+      super(name);
+    }
+  }
+
+  public static TestTrace createTrace() {
+    return new TestTrace();
+  }
+
+  public static TestSegment createSegment(String name) {
+    return new TestSegment(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
new file mode 100644
index 0000000..03f1f1c
--- /dev/null
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/TestUtils.java
@@ -0,0 +1,161 @@
+/**
+ * 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.
+ */
+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;
+
+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 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));
+      }
+    }
+  }
+
+  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());
+    }
+  }
+
+  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;
+        }
+      }
+      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 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
new file mode 100644
index 0000000..19575bc
--- /dev/null
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/TwoService2Test.java
@@ -0,0 +1,60 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray;
+
+import org.apache.camel.RoutesBuilder;
+import org.apache.camel.builder.RouteBuilder;
+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"))
+                )
+            )
+    );
+  }
+
+  @Test
+  public void testRoute() throws Exception {
+    template.requestBody("direct:ServiceA", "Hello");
+
+    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");
+
+        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
new file mode 100644
index 0000000..2efa720
--- /dev/null
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/TwoServiceTest.java
@@ -0,0 +1,60 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray;
+
+import org.apache.camel.RoutesBuilder;
+import org.apache.camel.builder.RouteBuilder;
+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"))
+                )
+            )
+    );
+  }
+
+  @Test
+  public void testRoute() throws Exception {
+    template.requestBody("direct:ServiceA", "Hello");
+
+    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");
+
+        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
new file mode 100644
index 0000000..84f049c
--- /dev/null
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/TwoServiceWithExcludeTest.java
@@ -0,0 +1,65 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray;
+
+import java.util.Collections;
+import java.util.Set;
+import org.apache.camel.RoutesBuilder;
+import org.apache.camel.builder.RouteBuilder;
+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"))
+            )
+    );
+  }
+
+  @Override
+  protected Set<String> getExcludePatterns() {
+    return Collections.singleton("ServiceB");
+  }
+
+  @Test
+  public void testRoute() throws Exception {
+    template.requestBody("direct:ServiceA", "Hello");
+
+    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");
+
+        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
new file mode 100644
index 0000000..ad0fd41
--- /dev/null
+++ b/components/camel-aws-xray/src/test/resources/logback-test.xml
@@ -0,0 +1,47 @@
+<?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.
+-->
+<configuration debug="true">
+
+  <appender class="ch.qos.logback.core.ConsoleAppender" name="RootConsoleAppender">
+    <encoder>
+      <pattern>[%-5level] [%40thread] [%-30.30logger{5}] - %msg %n</pattern>
+    </encoder>
+  </appender>
+
+  <appender name="RollingFileAppender"
+    class="ch.qos.logback.core.rolling.RollingFileAppender">
+    <file>logs/test.log</file>
+    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+      <!-- daily rollover -->
+      <fileNamePattern>test.%d{yyyy-MM-dd}.%i.gz</fileNamePattern>
+      <maxHistory>5</maxHistory>
+    </rollingPolicy>
+    <encoder>
+      <pattern>[%-5level] %-14.14X{camel.breadcrumbId} - %12.-12X{camel.routeId} - %msg [%thread] [%logger{5}] %n</pattern>
+    </encoder>
+  </appender>
+
+  <logger name="org.apache.camel" level="info"/>
+  <logger name="org.apache.camel.component.aws.xray" level="trace"/>
+  <logger name="com.amazonaws.xray" level="trace"/>
+
+  <root>
+    <level value="info"/>
+    <appender-ref ref="RootConsoleAppender"/>
+  </root>
+</configuration>
\ No newline at end of file
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
new file mode 100644
index 0000000..016d3c0
--- /dev/null
+++ b/components/camel-aws-xray/src/test/resources/org.apache.camel.aws.xray/AwsXRaySimpleRouteTest.xml
@@ -0,0 +1,45 @@
+<?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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="
+       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+       http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+    ">
+
+  <bean id="aws-xray-tracer" class="org.apache.camel.component.aws.xray.XRayTracer" />
+
+  <camelContext xmlns="http://camel.apache.org/schema/spring">
+    <route id="dude">
+      <from uri="seda:dude"/>
+      <log message="Routing at ${routeId}"/>
+      <delay>
+        <simple>${random(1000,2000)}</simple>
+      </delay>
+      <to uri="direct:car"/>
+    </route>
+    <route id="car">
+      <from uri="direct:car"/>
+      <log message="Routing at ${routeId}"/>
+      <delay>
+        <simple>${random(1000,2000)}</simple>
+      </delay>
+    </route>
+  </camelContext>
+
+</beans>
diff --git a/components/pom.xml b/components/pom.xml
index 00f4967..7b0df17 100644
--- a/components/pom.xml
+++ b/components/pom.xml
@@ -315,6 +315,7 @@
     <module>camel-zipkin</module>
     <module>camel-zookeeper</module>
     <module>camel-zookeeper-master</module>
+    <module>camel-aws-xray</module>
   </modules>
 
 

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

[camel] 02/08: Fixed typo in documentation

Posted by ac...@apache.org.
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 a142a2ec9992197c2f784388d6975211f88ef86a
Author: Roman Vottner <ro...@gmx.at>
AuthorDate: Tue Oct 31 15:11:48 2017 +0100

    Fixed typo in documentation
---
 components/camel-aws-xray/src/main/docs/awsxray.adoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/components/camel-aws-xray/src/main/docs/awsxray.adoc b/components/camel-aws-xray/src/main/docs/awsxray.adoc
index ffae7aa..94f7692 100644
--- a/components/camel-aws-xray/src/main/docs/awsxray.adoc
+++ b/components/camel-aws-xray/src/main/docs/awsxray.adoc
@@ -30,7 +30,7 @@ To include both, AWS XRay and Camel, dependencies use the following Maven import
   <dependencies>
       <dependency>
         <groupId>org.apache.camel</groupId>
-        <artifactId>camel-aws.xray</artifactId>
+        <artifactId>camel-aws-xray</artifactId>
       </dependency>
 
       <dependency>

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

[camel] 05/08: Added decorator support similar to OpenTracing

Posted by ac...@apache.org.
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 b3325893cfb66150dd526a943d9c47e7d0dddfe9
Author: Roman Vottner <ro...@gmx.at>
AuthorDate: Wed Nov 1 20:52:48 2017 +0100

    Added decorator support similar to OpenTracing
---
 .../camel/component/aws/xray/SegmentDecorator.java |  83 +++++++++++++++++
 .../camel/component/aws/xray/XRayTracer.java       |  67 +++++++++++---
 .../xray/decorators/AbstractSegmentDecorator.java  | 101 ++++++++++++++++++++
 .../aws/xray/decorators/CqlSegmentDecorator.java   |  58 ++++++++++++
 .../decorators/ElasticsearchSegmentDecorator.java  |  59 ++++++++++++
 .../aws/xray/decorators/JdbcSegmentDecorator.java  |  41 +++++++++
 .../aws/xray/decorators/LogSegmentDecorator.java   |  30 ++++++
 .../xray/decorators/MongoDBSegmentDecorator.java   |  52 +++++++++++
 .../aws/xray/decorators/SqlSegmentDecorator.java   |  43 +++++++++
 .../aws/xray/decorators/TimerSegmentDecorator.java |  34 +++++++
 .../http/AbstractHttpSegmentDecorator.java         | 102 +++++++++++++++++++++
 .../xray/decorators/http/AhcSegmentDecorator.java  |  25 +++++
 .../decorators/http/Http4SegmentDecorator.java     |  25 +++++
 .../xray/decorators/http/HttpSegmentDecorator.java |  25 +++++
 .../decorators/http/JettySegmentDecorator.java     |  25 +++++
 .../http/NettyHttp4SegmentDecorator.java           |  25 +++++
 .../decorators/http/NettyHttpSegmentDecorator.java |  25 +++++
 .../xray/decorators/http/RestSegmentDecorator.java | 101 ++++++++++++++++++++
 .../decorators/http/RestletSegmentDecorator.java   |  25 +++++
 .../decorators/http/ServletSegmentDecorator.java   |  25 +++++
 .../decorators/http/UndertowSegmentDecorator.java  |  25 +++++
 .../internal/AbstractInternalSegmentDecorator.java |  31 +++++++
 .../internal/DirectSegmentDecorator.java           |  25 +++++
 .../internal/DirectvmSegmentDecorator.java         |  25 +++++
 .../internal/DisruptorSegmentDecorator.java        |  25 +++++
 .../internal/DisruptorvmSegmentDecorator.java      |  25 +++++
 .../decorators/internal/SedaSegmentDecorator.java  |  25 +++++
 .../decorators/internal/VmSegmentDecorator.java    |  25 +++++
 .../AbstractMessagingSegmentDecorator.java         |  52 +++++++++++
 .../decorators/messaging/AmqpSegmentDecorator.java |  25 +++++
 .../messaging/AwsSnsSegmentDecorator.java          |  34 +++++++
 .../messaging/AwsSqsSegmentDecorator.java          |  34 +++++++
 .../messaging/CometdSegmentDecorator.java          |  35 +++++++
 .../messaging/CometdsSegmentDecorator.java         |  25 +++++
 .../messaging/IronmqSegmentDecorator.java          |  34 +++++++
 .../decorators/messaging/JmsSegmentDecorator.java  |  34 +++++++
 .../messaging/KafkaSegmentDecorator.java           |  80 ++++++++++++++++
 .../decorators/messaging/MqttSegmentDecorator.java |  42 +++++++++
 .../decorators/messaging/PahoSegmentDecorator.java |  25 +++++
 .../messaging/RabbitmqSegmentDecorator.java        |  38 ++++++++
 .../decorators/messaging/SjmsSegmentDecorator.java |  25 +++++
 .../messaging/StompSegmentDecorator.java           |  36 ++++++++
 .../camel/component/aws/xray/ABCRouteTest.java     |   8 +-
 .../camel/component/aws/xray/BeanTracingTest.java  |   4 +-
 .../aws/xray/ClientRecipientListRouteTest.java     |   6 +-
 .../camel/component/aws/xray/EIPTracingTest.java   |   4 +-
 .../component/aws/xray/ErrorHandlingTest.java      |   4 +-
 .../aws/xray/MulticastParallelRouteTest.java       |   8 +-
 .../component/aws/xray/MulticastRouteTest.java     |   8 +-
 .../camel/component/aws/xray/TwoService2Test.java  |   2 +-
 .../camel/component/aws/xray/TwoServiceTest.java   |   2 +-
 .../aws/xray/TwoServiceWithExcludeTest.java        |   2 +-
 52 files changed, 1708 insertions(+), 36 deletions(-)

diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/SegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/SegmentDecorator.java
new file mode 100644
index 0000000..9656f70
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/SegmentDecorator.java
@@ -0,0 +1,83 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray;
+
+import com.amazonaws.xray.entities.Entity;
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.component.aws.xray.decorators.AbstractSegmentDecorator;
+
+/**
+ * This interface represents a decorator specific to the component/endpoint being instrumented.
+ */
+public interface SegmentDecorator {
+
+    /* Prefix for camel component tag */
+    String CAMEL_COMPONENT = "camel-";
+
+    SegmentDecorator DEFAULT = new AbstractSegmentDecorator() {
+
+        @Override
+        public String getComponent() {
+            return null;
+        }
+    };
+
+    /**
+     * This method indicates whether the component associated with the SegmentDecorator should result in a new segment
+     * being created.
+     *
+     * @return Whether a new segment should be created
+     */
+    boolean newSegment();
+
+    /**
+     * The camel component associated with the decorator.
+     *
+     * @return The camel component name
+     */
+    String getComponent();
+
+    /**
+     * This method returns the operation name to use with the segment representing this exchange and endpoint.
+     *
+     * @param exchange The exchange
+     * @param endpoint The endpoint
+     * @return The operation name
+     */
+    String getOperationName(Exchange exchange, Endpoint endpoint);
+
+    /**
+     * This method adds appropriate details (tags/logs) to the supplied segment based on the pre processing of the
+     * exchange.
+     *
+     * @param segment The segment
+     * @param exchange The exchange
+     * @param endpoint The endpoint
+     */
+    void pre(Entity segment, Exchange exchange, Endpoint endpoint);
+
+    /**
+     * This method adds appropriate details (tags/logs) to the supplied segment based on the post processing of the
+     * exchange.
+     *
+     * @param segment The segment
+     * @param exchange The exchange
+     * @param endpoint The endpoint
+     */
+    void post(Entity segment, Exchange exchange, Endpoint endpoint);
+}
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 0cedcd6..d6dcae2 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
@@ -17,9 +17,8 @@
 package org.apache.camel.component.aws.xray;
 
 import java.lang.invoke.MethodHandles;
-import java.util.EventObject;
-import java.util.HashSet;
-import java.util.Set;
+import java.net.URI;
+import java.util.*;
 
 import com.amazonaws.xray.AWSXRay;
 import com.amazonaws.xray.entities.Segment;
@@ -28,6 +27,7 @@ import com.amazonaws.xray.entities.TraceID;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.CamelContextAware;
+import org.apache.camel.Endpoint;
 import org.apache.camel.Exchange;
 import org.apache.camel.Route;
 import org.apache.camel.StaticService;
@@ -69,6 +69,8 @@ public class XRayTracer extends ServiceSupport implements RoutePolicyFactory, St
 
     private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
+    private static Map<String, SegmentDecorator> decorators = new HashMap<>();
+
     /** Exchange property for passing a segment between threads **/
     private static final String CURRENT_SEGMENT = "CAMEL_PROPERTY_AWS_XRAY_CURRENT_SEGMENT";
 
@@ -78,6 +80,17 @@ public class XRayTracer extends ServiceSupport implements RoutePolicyFactory, St
     private Set<String> excludePatterns = new HashSet<>();
     private InterceptStrategy tracingStrategy;
 
+    static {
+        ServiceLoader.load(SegmentDecorator.class).forEach(d -> {
+            SegmentDecorator existing = decorators.get(d.getComponent());
+            // Add segment decorator only if no existing decorator for the component exists yet or if we have have a
+            // derived one. This allows custom decorators to be added if they extend the standard decorators
+            if (existing == null || existing.getClass().isInstance(d)) {
+                decorators.put(d.getComponent(), d);
+            }
+        });
+    }
+
     @Override
     public void setCamelContext(CamelContext camelContext) {
         this.camelContext = camelContext;
@@ -153,10 +166,10 @@ public class XRayTracer extends ServiceSupport implements RoutePolicyFactory, St
     /**
      * Specifies the instance responsible for tracking invoked EIP and beans with AWS XRay.
      *
-     * @param traceingStrategy The instance which tracks invoked EIP and beans
+     * @param tracingStrategy The instance which tracks invoked EIP and beans
      */
-    public void setTracingStrategy(InterceptStrategy traceingStrategy) {
-        this.tracingStrategy = traceingStrategy;
+    public void setTracingStrategy(InterceptStrategy tracingStrategy) {
+        this.tracingStrategy = tracingStrategy;
     }
 
     /**
@@ -202,6 +215,14 @@ public class XRayTracer extends ServiceSupport implements RoutePolicyFactory, St
         return false;
     }
 
+    protected SegmentDecorator getSegmentDecorator(Endpoint endpoint) {
+        SegmentDecorator sd = decorators.get(URI.create(endpoint.getEndpointUri()).getScheme());
+        if (null == sd) {
+            return SegmentDecorator.DEFAULT;
+        }
+        return sd;
+    }
+
     /**
      * Custom camel event handler that will create a new {@link Subsegment XRay subsegment} in case
      * the current exchange is forwarded via <code>.to(someEndpoint)</code> to some endpoint and
@@ -239,13 +260,16 @@ public class XRayTracer extends ServiceSupport implements RoutePolicyFactory, St
                     AWSXRay.setTraceEntity(segment);
                 }
 
+                SegmentDecorator sd = getSegmentDecorator(ese.getEndpoint());
+                if (!sd.newSegment()) {
+                    return;
+                }
+
                 if (AWSXRay.getCurrentSegmentOptional().isPresent()) {
-                    String endpointName = ese.getEndpoint().getEndpointKey();
-                    // AWS XRay does only allow a certain set of characters to appear within a name
-                    // Allowed characters: a-z, A-Z, 0-9, _, ., :, /, %, &, #, =, +, \, -, @
-                    endpointName = endpointName.replaceAll("://", "_");
-                    endpointName = endpointName.replaceAll("\\?", "&");
-                    Subsegment subsegment = AWSXRay.beginSubsegment("SendingTo_" + endpointName);
+//                    // AWS XRay does only allow a certain set of characters to appear within a name
+//                    // Allowed characters: a-z, A-Z, 0-9, _, ., :, /, %, &, #, =, +, \, -, @
+                    Subsegment subsegment = AWSXRay.beginSubsegment(sd.getOperationName(ese.getExchange(), ese.getEndpoint()));
+                    sd.pre(subsegment, ese.getExchange(), ese.getEndpoint());
                     LOG.trace("Creating new subsegment with ID {} and name {}",
                             subsegment.getId(), subsegment.getName());
                 } else {
@@ -257,8 +281,11 @@ public class XRayTracer extends ServiceSupport implements RoutePolicyFactory, St
                 LOG.trace("-> {} - target: {} (routeId: {})",
                         event.getClass().getSimpleName(), ese.getEndpoint(), ese.getExchange().getFromRouteId());
 
+                SegmentDecorator sd = getSegmentDecorator(ese.getEndpoint());
+
                 if (AWSXRay.getCurrentSubsegmentOptional().isPresent()) {
                     Subsegment subsegment = AWSXRay.getCurrentSubsegment();
+                    sd.post(subsegment, ese.getExchange(), ese.getEndpoint());
                     subsegment.close();
                     LOG.trace("Closing down subsegment with ID {} and name {}",
                             subsegment.getId(), subsegment.getName());
@@ -274,6 +301,11 @@ public class XRayTracer extends ServiceSupport implements RoutePolicyFactory, St
             return event instanceof ExchangeSendingEvent
                     || event instanceof ExchangeSentEvent;
         }
+
+        @Override
+        public String toString() {
+            return "XRayEventNotifier";
+        }
     }
 
     /**
@@ -316,14 +348,17 @@ public class XRayTracer extends ServiceSupport implements RoutePolicyFactory, St
                 exchange.getIn().setHeader(XRAY_TRACE_ID, traceID.toString());
             }
 
+            SegmentDecorator sd = getSegmentDecorator(route.getEndpoint());
             if (!AWSXRay.getCurrentSegmentOptional().isPresent()) {
                 Segment segment = AWSXRay.beginSegment(route.getId());
                 segment.setTraceId(traceID);
+                sd.pre(segment, exchange, route.getEndpoint());
                 LOG.trace("Created new XRay segment {} with name {}",
                         segment.getId(), segment.getName());
                 exchange.setProperty(CURRENT_SEGMENT, segment);
             } else {
                 Subsegment subsegment = AWSXRay.beginSubsegment(route.getId());
+                sd.pre(subsegment, exchange, route.getEndpoint());
                 LOG.trace("Created new XRay subsegment {} with name {}",
                         subsegment.getId(), subsegment.getName());
             }
@@ -338,17 +373,25 @@ public class XRayTracer extends ServiceSupport implements RoutePolicyFactory, St
 
             LOG.trace("=> RoutePolicy-Done: Route: {} - RouteId: {}", routeId, route.getId());
 
+            SegmentDecorator sd = getSegmentDecorator(route.getEndpoint());
             if (AWSXRay.getCurrentSubsegmentOptional().isPresent()) {
                 Subsegment subsegment = AWSXRay.getCurrentSubsegment();
+                sd.post(subsegment, exchange, route.getEndpoint());
                 subsegment.close();
                 LOG.trace("Closing down Subsegment {} with name {}",
                         subsegment.getId(), subsegment.getName());
             } else if (AWSXRay.getCurrentSegmentOptional().isPresent()) {
                 Segment segment = AWSXRay.getCurrentSegment();
+                sd.post(segment, exchange, route.getEndpoint());
                 segment.close();
                 LOG.trace("Closing down Segment {} with name {}",
                         segment.getId(), segment.getName());
             }
         }
+
+        @Override
+        public String toString() {
+            return "XRayRoutePolicy";
+        }
     }
 }
\ No newline at end of file
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/AbstractSegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/AbstractSegmentDecorator.java
new file mode 100644
index 0000000..f5403a5
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/AbstractSegmentDecorator.java
@@ -0,0 +1,101 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.decorators;
+
+import java.net.URI;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import com.amazonaws.xray.entities.Entity;
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.component.aws.xray.SegmentDecorator;
+import org.apache.camel.util.URISupport;
+
+/**
+ * An abstract base implementation of the {@link SegmentDecorator} interface.
+ */
+public abstract class AbstractSegmentDecorator implements SegmentDecorator {
+
+    @Override
+    public boolean newSegment() {
+        return true;
+    }
+
+    @Override
+    public String getOperationName(Exchange exchange, Endpoint endpoint) {
+        URI uri = URI.create(endpoint.getEndpointUri());
+        return uri.getScheme() + "-" + uri.getRawAuthority();
+    }
+
+    @Override
+    public void pre(Entity segment, Exchange exchange, Endpoint endpoint) {
+        segment.putMetadata("component", CAMEL_COMPONENT + URI.create(endpoint.getEndpointUri()).getScheme());
+        segment.putMetadata("camel.uri", URISupport.sanitizeUri(endpoint.getEndpointUri()));
+    }
+
+    @Override
+    public void post(Entity segment, Exchange exchange, Endpoint endpoint) {
+        if (exchange.isFailed()) {
+            segment.setFault(true);
+            if (exchange.getException() != null) {
+                segment.addException(exchange.getException());
+            }
+        }
+    }
+
+    /**
+     * This method removes the scheme, any leading slash characters and options from the supplied URI. This is intended
+     * to extract a meaningful name from the URI that can be used in situations, such as the operation name.
+     *
+     * @param endpoint The endpoint
+     * @return The stripped value from the URI
+     */
+    public static String stripSchemeAndOptions(Endpoint endpoint) {
+        int start = endpoint.getEndpointUri().indexOf(":");
+        start++;
+        // Remove any leading '/'
+        while (endpoint.getEndpointUri().charAt(start) == '/') {
+            start++;
+        }
+        int end = endpoint.getEndpointUri().indexOf("?");
+        return end == -1 ? endpoint.getEndpointUri().substring(start) : endpoint.getEndpointUri().substring(start, end);
+    }
+
+    /**
+     * Extracts any parameters passed in the given URI as a key-value representation.
+     *
+     * @param uri The URI to extract passed parameters from
+     * @return A {@link Map} representation of the contained parameters of the provided URI
+     */
+    public static Map<String,  String> toQueryParameters(String uri) {
+        int index = uri.indexOf("?");
+        if (index != -1) {
+            String queryString = uri.substring(index + 1);
+            Map<String, String> map = new HashMap<>();
+            for (String param : queryString.split("&")) {
+                String[] parts = param.split("=");
+                if (parts.length == 2) {
+                    map.put(parts[0], parts[1]);
+                }
+            }
+            return map;
+        }
+        return Collections.emptyMap();
+    }
+}
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/CqlSegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/CqlSegmentDecorator.java
new file mode 100644
index 0000000..8d691e6
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/CqlSegmentDecorator.java
@@ -0,0 +1,58 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.decorators;
+
+import java.net.URI;
+import java.util.Map;
+
+import com.amazonaws.xray.entities.Entity;
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+
+public class CqlSegmentDecorator extends AbstractSegmentDecorator {
+
+    public static final String CASSANDRA_DB_TYPE = "cassandra";
+    protected static final String CAMEL_CQL_QUERY = "CamelCqlQuery";
+
+    @Override
+    public String getComponent() {
+        return "cql";
+    }
+
+    @Override
+    public void pre(Entity segment, Exchange exchange, Endpoint endpoint) {
+        super.pre(segment, exchange, endpoint);
+
+        segment.putMetadata("db.type", CASSANDRA_DB_TYPE);
+
+        URI uri = URI.create(endpoint.getEndpointUri());
+        if (uri.getPath() != null && uri.getPath().length() > 0) {
+            // Strip leading '/' from path
+            segment.putMetadata("db.instance", uri.getPath().substring(1));
+        }
+
+        Object cql = exchange.getIn().getHeader(CAMEL_CQL_QUERY);
+        if (cql != null) {
+            segment.putSql("db.statement", cql);
+        } else {
+            Map<String, String> queryParameters = toQueryParameters(endpoint.getEndpointUri());
+            if (queryParameters.containsKey("cql")) {
+                segment.putSql("db.statement", queryParameters.get("cql"));
+            }
+        }
+    }
+}
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/ElasticsearchSegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/ElasticsearchSegmentDecorator.java
new file mode 100644
index 0000000..000d0cb
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/ElasticsearchSegmentDecorator.java
@@ -0,0 +1,59 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.decorators;
+
+import java.util.Map;
+
+import com.amazonaws.xray.entities.Entity;
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+
+public class ElasticsearchSegmentDecorator extends AbstractSegmentDecorator {
+
+    public static final String ELASTICSARCH_DB_TYPE = "elasticsearch";
+    public static final String ELASTICSEARCH_CLUSTER_TAG = "elasticsearch.cluster";
+
+    @Override
+    public String getComponent() {
+        return "elasticsearch";
+    }
+
+    @Override
+    public String getOperationName(Exchange exchange, Endpoint endpoint) {
+        Map<String, String> queryParameters = toQueryParameters(endpoint.getEndpointUri());
+        return queryParameters.containsKey("operation")
+                ? queryParameters.get("operation")
+                : super.getOperationName(exchange, endpoint);
+    }
+
+    @Override
+    public void pre(Entity segment, Exchange exchange, Endpoint endpoint) {
+        super.pre(segment, exchange, endpoint);
+
+        segment.putMetadata("db.type", ELASTICSARCH_DB_TYPE);
+
+        Map<String, String> queryParameters = toQueryParameters(endpoint.getEndpointUri());
+        if (queryParameters.containsKey("indexName")) {
+            segment.putMetadata("db.instance", queryParameters.get("indexName"));
+        }
+
+        String cluster = stripSchemeAndOptions(endpoint);
+        if (null != cluster) {
+            segment.putMetadata(ELASTICSEARCH_CLUSTER_TAG, cluster);
+        }
+    }
+}
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/JdbcSegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/JdbcSegmentDecorator.java
new file mode 100644
index 0000000..43b0146
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/JdbcSegmentDecorator.java
@@ -0,0 +1,41 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.decorators;
+
+import com.amazonaws.xray.entities.Entity;
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+
+public class JdbcSegmentDecorator extends AbstractSegmentDecorator {
+
+    @Override
+    public String getComponent() {
+        return "jdbc";
+    }
+
+    @Override
+    public void pre(Entity segment, Exchange exchange, Endpoint endpoint) {
+        super.pre(segment, exchange, endpoint);
+
+        segment.putMetadata("db.type", "sql");
+
+        Object body = exchange.getIn().getBody();
+        if (body instanceof String) {
+            segment.putMetadata("db.statement", body);
+        }
+    }
+}
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/LogSegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/LogSegmentDecorator.java
new file mode 100644
index 0000000..fafd3a5
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/LogSegmentDecorator.java
@@ -0,0 +1,30 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.decorators;
+
+public class LogSegmentDecorator extends AbstractSegmentDecorator {
+
+    @Override
+    public String getComponent() {
+        return "log";
+    }
+
+    @Override
+    public boolean newSegment() {
+        return false;
+    }
+}
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/MongoDBSegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/MongoDBSegmentDecorator.java
new file mode 100644
index 0000000..f7aebc1
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/MongoDBSegmentDecorator.java
@@ -0,0 +1,52 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.decorators;
+
+import java.util.Map;
+
+import com.amazonaws.xray.entities.Entity;
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+
+public class MongoDBSegmentDecorator extends AbstractSegmentDecorator {
+
+    @Override
+    public String getComponent() {
+        return "mongodb";
+    }
+
+    @Override
+    public String getOperationName(Exchange exchange, Endpoint endpoint) {
+        Map<String, String> queryParameters = toQueryParameters(endpoint.getEndpointUri());
+        String opName = queryParameters.get("operation");
+        return opName != null ? opName : super.getOperationName(exchange, endpoint);
+    }
+
+    @Override
+    public void pre(Entity segment, Exchange exchange, Endpoint endpoint) {
+        super.pre(segment, exchange, endpoint);
+
+        segment.putMetadata("db.type", getComponent());
+
+        Map<String, String> queryParameters = toQueryParameters(endpoint.getEndpointUri());
+        String database = queryParameters.get("database");
+        if (null != database) {
+            segment.putMetadata("db.instance", database);
+        }
+        segment.putSql("db.statement", queryParameters.toString());
+    }
+}
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/SqlSegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/SqlSegmentDecorator.java
new file mode 100644
index 0000000..681af4e
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/SqlSegmentDecorator.java
@@ -0,0 +1,43 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.decorators;
+
+import com.amazonaws.xray.entities.Entity;
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+
+public class SqlSegmentDecorator extends AbstractSegmentDecorator {
+
+    public static final String CAMEL_SQL_QUERY = "CamelSqlQuery";
+
+    @Override
+    public String getComponent() {
+        return "sql";
+    }
+
+    @Override
+    public void pre(Entity segment, Exchange exchange, Endpoint endpoint) {
+        super.pre(segment, exchange, endpoint);
+
+        segment.putMetadata("db.type", "sql");
+
+        Object sqlQuery = exchange.getIn().getHeader(CAMEL_SQL_QUERY);
+        if (sqlQuery instanceof String) {
+            segment.putSql("db.statement", sqlQuery);
+        }
+    }
+}
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/TimerSegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/TimerSegmentDecorator.java
new file mode 100644
index 0000000..e1d8247
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/TimerSegmentDecorator.java
@@ -0,0 +1,34 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.decorators;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+
+public class TimerSegmentDecorator extends AbstractSegmentDecorator {
+
+    @Override
+    public String getComponent() {
+        return "timer";
+    }
+
+    @Override
+    public String getOperationName(Exchange exchange, Endpoint endpoint) {
+        Object name = exchange.getProperty(Exchange.TIMER_NAME);
+        return name instanceof String ? (String) name : super.getOperationName(exchange, endpoint);
+    }
+}
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/AbstractHttpSegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/AbstractHttpSegmentDecorator.java
new file mode 100644
index 0000000..07914da
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/AbstractHttpSegmentDecorator.java
@@ -0,0 +1,102 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.decorators.http;
+
+import com.amazonaws.xray.entities.Entity;
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.component.aws.xray.decorators.AbstractSegmentDecorator;
+
+public abstract class AbstractHttpSegmentDecorator extends AbstractSegmentDecorator {
+
+    public static final String POST_METHOD = "POST";
+    public static final String GET_METHOD = "GET";
+
+    @Override
+    public String getOperationName(Exchange exchange, Endpoint endpoint) {
+        return getHttpMethod(exchange, endpoint);
+    }
+
+    @Override
+    public void pre(Entity segment, Exchange exchange, Endpoint endpoint) {
+        super.pre(segment, exchange, endpoint);
+
+        String httpUrl = getHttpUrl(exchange, endpoint);
+        if (httpUrl != null) {
+            segment.putMetadata("http.url", httpUrl);
+        }
+        segment.putMetadata("http.method", getHttpMethod(exchange, endpoint));
+    }
+
+    @Override
+    public void post(Entity segment, Exchange exchange, Endpoint endpoint) {
+        super.post(segment, exchange, endpoint);
+
+        if (exchange.hasOut()) {
+            Object responseCode = exchange.getOut().getHeader(Exchange.HTTP_RESPONSE_CODE);
+            if (responseCode instanceof Integer) {
+                segment.putMetadata("htt.response.code", responseCode);
+            }
+        }
+    }
+
+    protected String getHttpMethod(Exchange exchange, Endpoint endpoint) {
+        // 1. Use method provided in header.
+        Object method = exchange.getIn().getHeader(Exchange.HTTP_METHOD);
+        if (method instanceof String) {
+            return (String)method;
+        }
+
+        // 2. GET if query string is provided in header.
+        if (exchange.getIn().getHeader(Exchange.HTTP_QUERY) != null) {
+            return GET_METHOD;
+        }
+
+        // 3. GET if endpoint is configured with a query string.
+        if (endpoint.getEndpointUri().indexOf('?') != -1) {
+            return GET_METHOD;
+        }
+
+        // 4. POST if there is data to send (body is not null).
+        if (exchange.getIn().getBody() != null) {
+            return POST_METHOD;
+        }
+
+        // 5. GET otherwise.
+        return GET_METHOD;
+    }
+
+
+    protected String getHttpUrl(Exchange exchange, Endpoint endpoint) {
+        Object url = exchange.getIn().getHeader(Exchange.HTTP_URL);
+        if (url instanceof String) {
+            return (String) url;
+        } else {
+            Object uri = exchange.getIn().getHeader(Exchange.HTTP_URI);
+            if (uri instanceof String) {
+                return (String) uri;
+            } else {
+                // Try to obtain from endpoint
+                int index = endpoint.getEndpointUri().lastIndexOf("http:");
+                if (index != -1) {
+                    return endpoint.getEndpointUri().substring(index);
+                }
+            }
+        }
+        return null;
+    }
+}
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/AhcSegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/AhcSegmentDecorator.java
new file mode 100644
index 0000000..f1adea4
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/AhcSegmentDecorator.java
@@ -0,0 +1,25 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.decorators.http;
+
+public class AhcSegmentDecorator extends AbstractHttpSegmentDecorator {
+
+    @Override
+    public String getComponent() {
+        return "ahc";
+    }
+}
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/Http4SegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/Http4SegmentDecorator.java
new file mode 100644
index 0000000..171c370
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/Http4SegmentDecorator.java
@@ -0,0 +1,25 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.decorators.http;
+
+public class Http4SegmentDecorator extends AbstractHttpSegmentDecorator {
+
+    @Override
+    public String getComponent() {
+        return "http4";
+    }
+}
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/HttpSegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/HttpSegmentDecorator.java
new file mode 100644
index 0000000..847d6ff
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/HttpSegmentDecorator.java
@@ -0,0 +1,25 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.decorators.http;
+
+public class HttpSegmentDecorator extends AbstractHttpSegmentDecorator {
+
+    @Override
+    public String getComponent() {
+        return "http";
+    }
+}
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/JettySegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/JettySegmentDecorator.java
new file mode 100644
index 0000000..0d2bd45
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/JettySegmentDecorator.java
@@ -0,0 +1,25 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.decorators.http;
+
+public class JettySegmentDecorator extends AbstractHttpSegmentDecorator {
+
+    @Override
+    public String getComponent() {
+        return "jetty";
+    }
+}
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/NettyHttp4SegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/NettyHttp4SegmentDecorator.java
new file mode 100644
index 0000000..b1a7b85
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/NettyHttp4SegmentDecorator.java
@@ -0,0 +1,25 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.decorators.http;
+
+public class NettyHttp4SegmentDecorator extends AbstractHttpSegmentDecorator {
+
+    @Override
+    public String getComponent() {
+        return "netty-http4";
+    }
+}
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/NettyHttpSegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/NettyHttpSegmentDecorator.java
new file mode 100644
index 0000000..9d37143
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/NettyHttpSegmentDecorator.java
@@ -0,0 +1,25 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.decorators.http;
+
+public class NettyHttpSegmentDecorator extends AbstractHttpSegmentDecorator {
+
+    @Override
+    public String getComponent() {
+        return "netty-http";
+    }
+}
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/RestSegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/RestSegmentDecorator.java
new file mode 100644
index 0000000..5ab981a
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/RestSegmentDecorator.java
@@ -0,0 +1,101 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.decorators.http;
+
+import java.io.UnsupportedEncodingException;
+import java.lang.invoke.MethodHandles;
+import java.net.URLDecoder;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import com.amazonaws.xray.entities.Entity;
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class RestSegmentDecorator extends AbstractHttpSegmentDecorator {
+
+    private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
+    @Override
+    public String getComponent() {
+        return "rest";
+    }
+
+    @Override
+    public String getOperationName(Exchange exchange, Endpoint endpoint) {
+        return getPath(endpoint.getEndpointUri());
+    }
+
+    @Override
+    public void pre(Entity segment, Exchange exchange, Endpoint endpoint) {
+        super.pre(segment, exchange, endpoint);
+
+        getParameters(getPath(endpoint.getEndpointUri())).forEach(param -> {
+            Object value = exchange.getIn().getHeader(param);
+            if (value != null) {
+                segment.putMetadata(param, value);
+            }
+        });
+    }
+
+    protected static String getPath(String uri) {
+        // Obtain the 'path' part of the URI format: rest://method:path[:uriTemplate]?[options]
+        String path = null;
+        int index = uri.indexOf(':');
+        if (index != -1) {
+            index = uri.indexOf(':', index + 1);
+            if (index != -1) {
+                path = uri.substring(index + 1);
+                index = path.indexOf('?');
+                if (index != -1) {
+                    path = path.substring(0, index);
+                }
+                path = path.replaceAll(":", "");
+                try {
+                    path = URLDecoder.decode(path, "UTF-8");
+                } catch (UnsupportedEncodingException e) {
+                    LOG.debug("Failed to decode URL path '" + path + "', ignoring exception", e);
+                }
+            }
+        }
+        return path;
+    }
+
+    protected static List<String> getParameters(String path) {
+        List<String> parameters = null;
+
+        int startIndex = path.indexOf('{');
+        while (startIndex != -1) {
+            int endIndex = path.indexOf('}', startIndex);
+            if (endIndex != -1) {
+                if (parameters == null) {
+                    parameters = new ArrayList<>();
+                }
+                parameters.add(path.substring(startIndex + 1, endIndex));
+                startIndex = path.indexOf('{', endIndex);
+            } else {
+                // Break out of loop as no valid end token
+                startIndex = -1;
+            }
+        }
+
+        return parameters == null ? Collections.emptyList() : parameters;
+    }
+}
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/RestletSegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/RestletSegmentDecorator.java
new file mode 100644
index 0000000..743b51b
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/RestletSegmentDecorator.java
@@ -0,0 +1,25 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.decorators.http;
+
+public class RestletSegmentDecorator extends AbstractHttpSegmentDecorator {
+
+    @Override
+    public String getComponent() {
+        return "restlet";
+    }
+}
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/ServletSegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/ServletSegmentDecorator.java
new file mode 100644
index 0000000..577be50
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/ServletSegmentDecorator.java
@@ -0,0 +1,25 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.decorators.http;
+
+public class ServletSegmentDecorator extends AbstractHttpSegmentDecorator {
+
+    @Override
+    public String getComponent() {
+        return "servlet";
+    }
+}
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/UndertowSegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/UndertowSegmentDecorator.java
new file mode 100644
index 0000000..e972ca2
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/http/UndertowSegmentDecorator.java
@@ -0,0 +1,25 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.decorators.http;
+
+public class UndertowSegmentDecorator extends AbstractHttpSegmentDecorator {
+
+    @Override
+    public String getComponent() {
+        return "undertow";
+    }
+}
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/internal/AbstractInternalSegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/internal/AbstractInternalSegmentDecorator.java
new file mode 100644
index 0000000..d8bb656
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/internal/AbstractInternalSegmentDecorator.java
@@ -0,0 +1,31 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.decorators.internal;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.component.aws.xray.decorators.AbstractSegmentDecorator;
+
+public abstract class AbstractInternalSegmentDecorator extends AbstractSegmentDecorator {
+
+    @Override
+    public String getOperationName(Exchange exchange, Endpoint endpoint) {
+        // Internal communication use descriptive names, so suitable as an operation name, but need to strop the scheme
+        // and any options
+        return stripSchemeAndOptions(endpoint);
+    }
+}
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/internal/DirectSegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/internal/DirectSegmentDecorator.java
new file mode 100644
index 0000000..356c08d
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/internal/DirectSegmentDecorator.java
@@ -0,0 +1,25 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.decorators.internal;
+
+public class DirectSegmentDecorator extends AbstractInternalSegmentDecorator {
+
+    @Override
+    public String getComponent() {
+        return "direct";
+    }
+}
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/internal/DirectvmSegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/internal/DirectvmSegmentDecorator.java
new file mode 100644
index 0000000..a2098f7
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/internal/DirectvmSegmentDecorator.java
@@ -0,0 +1,25 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.decorators.internal;
+
+public class DirectvmSegmentDecorator extends AbstractInternalSegmentDecorator {
+
+    @Override
+    public String getComponent() {
+        return "direct-vm";
+    }
+}
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/internal/DisruptorSegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/internal/DisruptorSegmentDecorator.java
new file mode 100644
index 0000000..d006177
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/internal/DisruptorSegmentDecorator.java
@@ -0,0 +1,25 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.decorators.internal;
+
+public class DisruptorSegmentDecorator extends AbstractInternalSegmentDecorator {
+
+    @Override
+    public String getComponent() {
+        return "disruptor";
+    }
+}
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/internal/DisruptorvmSegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/internal/DisruptorvmSegmentDecorator.java
new file mode 100644
index 0000000..a12b3ab
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/internal/DisruptorvmSegmentDecorator.java
@@ -0,0 +1,25 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.decorators.internal;
+
+public class DisruptorvmSegmentDecorator extends AbstractInternalSegmentDecorator {
+
+    @Override
+    public String getComponent() {
+        return "disruptor-vm";
+    }
+}
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/internal/SedaSegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/internal/SedaSegmentDecorator.java
new file mode 100644
index 0000000..c7522c6
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/internal/SedaSegmentDecorator.java
@@ -0,0 +1,25 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.decorators.internal;
+
+public class SedaSegmentDecorator extends AbstractInternalSegmentDecorator {
+
+    @Override
+    public String getComponent() {
+        return "seda";
+    }
+}
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/internal/VmSegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/internal/VmSegmentDecorator.java
new file mode 100644
index 0000000..531d3c3
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/internal/VmSegmentDecorator.java
@@ -0,0 +1,25 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.decorators.internal;
+
+public class VmSegmentDecorator extends AbstractInternalSegmentDecorator {
+
+    @Override
+    public String getComponent() {
+        return "vm";
+    }
+}
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/AbstractMessagingSegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/AbstractMessagingSegmentDecorator.java
new file mode 100644
index 0000000..ac7c06f
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/AbstractMessagingSegmentDecorator.java
@@ -0,0 +1,52 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.decorators.messaging;
+
+import com.amazonaws.xray.entities.Entity;
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.component.aws.xray.decorators.AbstractSegmentDecorator;
+
+public abstract class AbstractMessagingSegmentDecorator extends AbstractSegmentDecorator {
+
+    protected static final String MESSAGE_BUS_ID = "message_bus.id";
+
+    @Override
+    public String getOperationName(Exchange exchange, Endpoint endpoint) {
+        return getDestination(exchange, endpoint);
+    }
+
+    @Override
+    public void pre(Entity segment, Exchange exchange, Endpoint endpoint) {
+        super.pre(segment, exchange, endpoint);
+
+        segment.putMetadata("message_bus.destination", getDestination(exchange, endpoint));
+
+        String messageId = getMessageId(exchange);
+        if (null != messageId) {
+            segment.putMetadata(MESSAGE_BUS_ID, messageId);
+        }
+    }
+
+    protected String getDestination(Exchange exchange, Endpoint endpoint) {
+        return stripSchemeAndOptions(endpoint);
+    }
+
+    protected String getMessageId(Exchange exchange) {
+        return null;
+    }
+}
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/AmqpSegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/AmqpSegmentDecorator.java
new file mode 100644
index 0000000..e8e4a47
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/AmqpSegmentDecorator.java
@@ -0,0 +1,25 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.decorators.messaging;
+
+public class AmqpSegmentDecorator extends AbstractMessagingSegmentDecorator {
+
+    @Override
+    public String getComponent() {
+        return "amqp";
+    }
+}
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/AwsSnsSegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/AwsSnsSegmentDecorator.java
new file mode 100644
index 0000000..53033b9
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/AwsSnsSegmentDecorator.java
@@ -0,0 +1,34 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.decorators.messaging;
+
+import org.apache.camel.Exchange;
+
+public class AwsSnsSegmentDecorator extends AbstractMessagingSegmentDecorator {
+
+    protected static final String CAMEL_AWS_SNS_MESSAGE_ID = "CamelAwsSnsMessageId";
+
+    @Override
+    public String getComponent() {
+        return "aws-sns";
+    }
+
+    @Override
+    protected String getMessageId(Exchange exchange) {
+        return (String) exchange.getIn().getHeader(CAMEL_AWS_SNS_MESSAGE_ID);
+    }
+}
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/AwsSqsSegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/AwsSqsSegmentDecorator.java
new file mode 100644
index 0000000..eabc901
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/AwsSqsSegmentDecorator.java
@@ -0,0 +1,34 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.decorators.messaging;
+
+import org.apache.camel.Exchange;
+
+public class AwsSqsSegmentDecorator extends AbstractMessagingSegmentDecorator {
+
+    protected static final String CAMEL_AWS_SQS_MESSAGE_ID = "CamelAwsSqsMessageId";
+
+    @Override
+    public String getComponent() {
+        return "aws-sqs";
+    }
+
+    @Override
+    public String getMessageId(Exchange exchange) {
+        return (String) exchange.getIn().getHeader(CAMEL_AWS_SQS_MESSAGE_ID);
+    }
+}
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/CometdSegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/CometdSegmentDecorator.java
new file mode 100644
index 0000000..19e52da
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/CometdSegmentDecorator.java
@@ -0,0 +1,35 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.decorators.messaging;
+
+import java.net.URI;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+
+public class CometdSegmentDecorator extends AbstractMessagingSegmentDecorator {
+
+    @Override
+    public String getComponent() {
+        return "cometd";
+    }
+
+    @Override
+    protected String getDestination(Exchange exchange, Endpoint endpoint) {
+        return URI.create(endpoint.getEndpointUri()).getPath().substring(1);
+    }
+}
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/CometdsSegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/CometdsSegmentDecorator.java
new file mode 100644
index 0000000..473cdaa
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/CometdsSegmentDecorator.java
@@ -0,0 +1,25 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.decorators.messaging;
+
+public class CometdsSegmentDecorator extends CometdSegmentDecorator {
+
+    @Override
+    public String getComponent() {
+        return "cometds";
+    }
+}
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/IronmqSegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/IronmqSegmentDecorator.java
new file mode 100644
index 0000000..e4274f5
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/IronmqSegmentDecorator.java
@@ -0,0 +1,34 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.decorators.messaging;
+
+import org.apache.camel.Exchange;
+
+public class IronmqSegmentDecorator extends AbstractMessagingSegmentDecorator {
+
+    public static final String CAMEL_IRON_MQ_MESSAGE_ID = "CamelIronMQMessageId";
+
+    @Override
+    public String getComponent() {
+        return "ironmq";
+    }
+
+    @Override
+    protected String getMessageId(Exchange exchange) {
+        return (String) exchange.getIn().getHeader(CAMEL_IRON_MQ_MESSAGE_ID);
+    }
+}
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/JmsSegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/JmsSegmentDecorator.java
new file mode 100644
index 0000000..e16fd94
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/JmsSegmentDecorator.java
@@ -0,0 +1,34 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.decorators.messaging;
+
+import org.apache.camel.Exchange;
+
+public class JmsSegmentDecorator extends AbstractMessagingSegmentDecorator {
+
+    public static final String JMS_MESSAGE_ID = "JMSMessageID";
+
+    @Override
+    public String getComponent() {
+        return "jms";
+    }
+
+    @Override
+    protected String getMessageId(Exchange exchange) {
+        return (String) exchange.getIn().getHeader(JMS_MESSAGE_ID);
+    }
+}
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/KafkaSegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/KafkaSegmentDecorator.java
new file mode 100644
index 0000000..014290a
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/KafkaSegmentDecorator.java
@@ -0,0 +1,80 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.decorators.messaging;
+
+import java.util.Map;
+
+import com.amazonaws.xray.entities.Entity;
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+
+public class KafkaSegmentDecorator extends AbstractMessagingSegmentDecorator {
+
+    public static final String KAFKA_PARTITION_TAG = "kafka.partition";
+    public static final String KAFKA_PARTITION_KEY_TAG = "kafka.partition.key";
+    public static final String KAFKA_KEY_TAG = "kafka.key";
+    public static final String KAFKA_OFFSET_TAG = "kafka.offset";
+
+    /**
+     * Constants copied from {@link org.apache.camel.component.kafka.KafkaConstants}
+     */
+    protected static final String PARTITION_KEY = "kafka.PARTITION_KEY";
+    protected static final String PARTITION = "kafka.PARTITION";
+    protected static final String KEY = "kafka.KEY";
+    protected static final String TOPIC = "kafka.TOPIC";
+    protected static final String OFFSET = "kafka.OFFSET";
+
+    @Override
+    public String getComponent() {
+        return "kafka";
+    }
+
+    @Override
+    public String getDestination(Exchange exchange, Endpoint endpoint) {
+        String topic = (String) exchange.getIn().getHeader(TOPIC);
+        if (topic == null) {
+            Map<String, String> queryParameters = toQueryParameters(endpoint.getEndpointUri());
+            topic = queryParameters.get("topic");
+        }
+        return topic != null ? topic : super.getDestination(exchange, endpoint);
+    }
+
+    @Override
+    public void pre(Entity segment, Exchange exchange, Endpoint endpoint) {
+        super.pre(segment, exchange, endpoint);
+
+        String partition = (String) exchange.getIn().getHeader(PARTITION);
+        if (partition != null) {
+            segment.putMetadata(KAFKA_PARTITION_TAG, partition);
+        }
+
+        String partitionKey = (String) exchange.getIn().getHeader(PARTITION_KEY);
+        if (partitionKey != null) {
+            segment.putMetadata(KAFKA_PARTITION_KEY_TAG, partitionKey);
+        }
+
+        String key = (String) exchange.getIn().getHeader(KEY);
+        if (key != null) {
+            segment.putMetadata(KAFKA_KEY_TAG, key);
+        }
+
+        String offset = (String) exchange.getIn().getHeader(OFFSET);
+        if (offset != null) {
+            segment.putMetadata(KAFKA_OFFSET_TAG, offset);
+        }
+    }
+}
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/MqttSegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/MqttSegmentDecorator.java
new file mode 100644
index 0000000..7d7be0b
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/MqttSegmentDecorator.java
@@ -0,0 +1,42 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.decorators.messaging;
+
+import java.util.Map;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+
+public class MqttSegmentDecorator extends AbstractMessagingSegmentDecorator {
+
+    @Override
+    public String getComponent() {
+        return "mqtt";
+    }
+
+    @Override
+    public String getOperationName(Exchange exchange, Endpoint endpoint) {
+        return stripSchemeAndOptions(endpoint);
+    }
+
+    @Override
+    protected String getDestination(Exchange exchange, Endpoint endpoint) {
+        Map<String, String> queryParameters = toQueryParameters(endpoint.getEndpointUri());
+        String destination = queryParameters.get("subscribeTopicNames");
+        return null != destination ?  destination : queryParameters.get("publishTopicName");
+    }
+}
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/PahoSegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/PahoSegmentDecorator.java
new file mode 100644
index 0000000..1b7a264
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/PahoSegmentDecorator.java
@@ -0,0 +1,25 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.decorators.messaging;
+
+public class PahoSegmentDecorator extends AbstractMessagingSegmentDecorator {
+
+    @Override
+    public String getComponent() {
+        return "paho";
+    }
+}
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/RabbitmqSegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/RabbitmqSegmentDecorator.java
new file mode 100644
index 0000000..d762527
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/RabbitmqSegmentDecorator.java
@@ -0,0 +1,38 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.decorators.messaging;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+
+public class RabbitmqSegmentDecorator extends AbstractMessagingSegmentDecorator {
+
+    /**
+     * Constants copied from {@link org.apache.camel.component.rabbitmq.RabbitMQConstants}
+     */
+    protected static final String EXCHANGE_NAME = "rabbitmq.EXCHANGE_NAME";
+
+    @Override
+    public String getComponent() {
+        return "rabbitmq";
+    }
+
+    @Override
+    public String getDestination(Exchange exchange, Endpoint endpoint) {
+        return (String) exchange.getIn().getHeader(EXCHANGE_NAME);
+    }
+}
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/SjmsSegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/SjmsSegmentDecorator.java
new file mode 100644
index 0000000..555b4e5
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/SjmsSegmentDecorator.java
@@ -0,0 +1,25 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.decorators.messaging;
+
+public class SjmsSegmentDecorator extends AbstractMessagingSegmentDecorator {
+
+    @Override
+    public String getComponent() {
+        return "sjms";
+    }
+}
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/StompSegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/StompSegmentDecorator.java
new file mode 100644
index 0000000..4960bc2
--- /dev/null
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/StompSegmentDecorator.java
@@ -0,0 +1,36 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.decorators.messaging;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+
+public class StompSegmentDecorator extends AbstractMessagingSegmentDecorator {
+
+    protected static final String QUEUE_PREFIX = "queue:";
+
+    @Override
+    public String getComponent() {
+        return "stomp";
+    }
+
+    @Override
+    public String getDestination(Exchange exchange, Endpoint endpoint) {
+        String destination = super.getDestination(exchange, endpoint);
+        return destination.startsWith(QUEUE_PREFIX) ? destination.substring(QUEUE_PREFIX.length()) :  destination;
+    }
+}
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 65790c1..5f9f493 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
@@ -25,16 +25,16 @@ public class ABCRouteTest extends CamelAwsXRayTestSupport {
         super(
             TestDataBuilder.createTrace().inRandomOrder()
                 .withSegment(TestDataBuilder.createSegment("start")
-                    .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_direct_a")
+                    .withSubsegment(TestDataBuilder.createSubsegment("direct-a")
                         .withSubsegment(TestDataBuilder.createSubsegment("a")
-                            .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_seda_b"))
-                            .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_seda_c"))
+                            .withSubsegment(TestDataBuilder.createSubsegment("seda-b"))
+                            .withSubsegment(TestDataBuilder.createSubsegment("seda-c"))
                         )
                     )
                 )
                 .withSegment(TestDataBuilder.createSegment("b"))
                 .withSegment(TestDataBuilder.createSegment("c")
-                    .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_log_test"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("log-test"))
                 )
                 .withSegment(TestDataBuilder.createSegment("d"))
         );
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 6a136e4..f4213ee 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
@@ -34,8 +34,8 @@ public class BeanTracingTest extends CamelAwsXRayTestSupport {
             TestDataBuilder.createTrace()
                 .withSegment(TestDataBuilder.createSegment("start")
                     .withSubsegment(TestDataBuilder.createSubsegment("TraceBean"))
-                    .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_seda_otherRoute"))
-                    .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_mock_end"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("seda-otherRoute"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("mock-end"))
                     .withAnnotation("body", "HELLO")
                     .withMetadata("originBody", "Hello")
                 )
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 ed2b457..dda8865 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
@@ -25,9 +25,9 @@ public class ClientRecipientListRouteTest extends CamelAwsXRayTestSupport {
         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"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("seda-a"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("seda-b"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("seda-c"))
                 )
                 .withSegment(TestDataBuilder.createSegment("a"))
                 .withSegment(TestDataBuilder.createSegment("b"))
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 998a6e4..650a072 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
@@ -37,10 +37,10 @@ public class EIPTracingTest extends CamelAwsXRayTestSupport {
                     .withSubsegment(TestDataBuilder.createSubsegment("bean"))
                     .withSubsegment(TestDataBuilder.createSubsegment("delay")
                         .withSubsegment(TestDataBuilder.createSubsegment("to")
-                            .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_seda_otherRoute"))
+                            .withSubsegment(TestDataBuilder.createSubsegment("seda-otherRoute"))
                         )
                         .withSubsegment(TestDataBuilder.createSubsegment("to")
-                            .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_mock_end"))
+                            .withSubsegment(TestDataBuilder.createSubsegment("mock-end"))
                         )
                     )
                     .withAnnotation("body", "HELLO")
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 2a1fa1d..e351684 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
@@ -46,8 +46,8 @@ public class ErrorHandlingTest extends CamelAwsXRayTestSupport {
                         .withSubsegment(TestDataBuilder.createSubsegment("TraceBean"))
 //                      .withSubsegment(TestDataBuilder.createSubsegment("ExceptionRetryProcessor"))
                         .withSubsegment(TestDataBuilder.createSubsegment("TraceBean"))
-                        .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_seda_otherRoute"))
-                        .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_mock_end"))
+                        .withSubsegment(TestDataBuilder.createSubsegment("seda-otherRoute"))
+                        .withSubsegment(TestDataBuilder.createSubsegment("mock-end"))
                 )
                 .withSegment(TestDataBuilder.createSegment("otherRoute"))
         );
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 257e0bb..25c60c3 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
@@ -25,15 +25,15 @@ public class MulticastParallelRouteTest extends CamelAwsXRayTestSupport {
         super(
             TestDataBuilder.createTrace().inRandomOrder()
                 .withSegment(TestDataBuilder.createSegment("start")
-                    .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_seda_a"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("seda-a"))
                 )
                 .withSegment(TestDataBuilder.createSegment("a").inRandomOrder()
-                    .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_seda_b"))
-                    .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_seda_c"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("seda-b"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("seda-c"))
                 )
                 .withSegment(TestDataBuilder.createSegment("b"))
                 .withSegment(TestDataBuilder.createSegment("c")
-                    .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_log_routing%20at%20$%7BrouteId%7D"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("log-routing%20at%20$%7BrouteId%7D"))
                 )
         );
     }
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 f981cf8..f8f4714 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
@@ -25,15 +25,15 @@ public class MulticastRouteTest extends CamelAwsXRayTestSupport {
         super(
             TestDataBuilder.createTrace()
                 .withSegment(TestDataBuilder.createSegment("start")
-                    .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_seda_a"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("seda-a"))
                 )
                 .withSegment(TestDataBuilder.createSegment("a")
-                    .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_seda_b"))
-                    .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_seda_c"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("seda-b"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("seda-c"))
                 )
                 .withSegment(TestDataBuilder.createSegment("b"))
                 .withSegment(TestDataBuilder.createSegment("c")
-                    .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_log_routing%20at%20$%7BrouteId%7D"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("log-routing%20at%20$%7BrouteId%7D"))
                 )
         );
     }
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 2e07219..e27b67c 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
@@ -26,7 +26,7 @@ public class TwoService2Test extends CamelAwsXRayTestSupport {
         super(
             TestDataBuilder.createTrace().inRandomOrder()
                 .withSegment(TestDataBuilder.createSegment("route1")
-                    .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_direct_ServiceB")
+                    .withSubsegment(TestDataBuilder.createSubsegment("direct-ServiceB")
                         .withSubsegment(TestDataBuilder.createSubsegment("route2"))
                     )
                 )
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 edf6aad..ffc45a1 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
@@ -26,7 +26,7 @@ public class TwoServiceTest extends CamelAwsXRayTestSupport {
         super(
             TestDataBuilder.createTrace().inRandomOrder()
                 .withSegment(TestDataBuilder.createSegment("ServiceA")
-                    .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_direct_ServiceB")
+                    .withSubsegment(TestDataBuilder.createSubsegment("direct-ServiceB")
                         .withSubsegment(TestDataBuilder.createSubsegment("ServiceB"))
                     )
                 )
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 5f2fac5..5c41078 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
@@ -28,7 +28,7 @@ public class TwoServiceWithExcludeTest extends CamelAwsXRayTestSupport {
         super(
             TestDataBuilder.createTrace().inRandomOrder()
                 .withSegment(TestDataBuilder.createSegment("ServiceA")
-                    .withSubsegment(TestDataBuilder.createSubsegment("SendingTo_direct_ServiceB"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("direct-ServiceB"))
                 )
         );
     }

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

[camel] 07/08: Minor typo fix

Posted by ac...@apache.org.
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 860352479b1fb10a132639331c8270661e003115
Author: Roman Vottner <ro...@gmx.at>
AuthorDate: Thu Nov 9 14:00:24 2017 +0100

    Minor typo fix
---
 .../test/java/org/apache/camel/component/aws/xray/BeanTracingTest.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 26f7547..5885648 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
@@ -88,7 +88,7 @@ public class BeanTracingTest extends CamelAwsXRayTestSupport {
     public static class TraceBean {
 
         @Handler
-        public String convertBocyToUpperCase(@Body String body) {
+        public String convertBodyToUpperCase(@Body String body) {
             String converted = body.toUpperCase();
             AWSXRay.getCurrentSegment().putAnnotation("body", converted);
             AWSXRay.getCurrentSegment().putMetadata("originBody", body);

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

[camel] 06/08: Improved the visualization of executed beans or prcoessors by appending the actual processed EIP separated by a colon to the actual name Added service loader provider configuration in oder for ServiceLoader to be able to find actual implementations Added a sanitizeName helper method as AWS does only allow a certain set of characters to appear within a (sub)segment name Updated some tests due to decorators now disable the tracing of i.e. .to("log:...") invocations

Posted by ac...@apache.org.
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 35905024787016306d4f682ebc1a53fd3cbf7d1b
Author: Roman Vottner <ro...@gmx.at>
AuthorDate: Thu Nov 9 13:56:43 2017 +0100

    Improved the visualization of executed beans or prcoessors by appending the actual processed EIP separated by a colon to the actual name
    Added service loader provider configuration in oder for ServiceLoader to be able to find actual implementations
    Added a sanitizeName helper method as AWS does only allow a certain set of characters to appear within a (sub)segment name
    Updated some tests due to decorators now disable the tracing of i.e. .to("log:...") invocations
---
 .../component/aws/xray/EIPTracingStrategy.java     |   4 +-
 .../aws/xray/TraceAnnotatedTracingStrategy.java    |   7 +-
 .../camel/component/aws/xray/XRayTracer.java       |  26 ++-
 .../xray/decorators/AbstractSegmentDecorator.java  |   2 +-
 .../aws/xray/decorators/JdbcSegmentDecorator.java  |   2 +-
 .../src/main/resources/META-INF/LICENSE.txt        | 203 +++++++++++++++++++++
 .../src/main/resources/META-INF/NOTICE.txt         |  11 ++
 ...pache.camel.component.aws.xray.SegmentDecorator |  56 ++++++
 .../camel/component/aws/xray/ABCRouteTest.java     |   9 +-
 .../camel/component/aws/xray/BeanTracingTest.java  |   8 +-
 .../aws/xray/ClientRecipientListRouteTest.java     |   6 +-
 .../camel/component/aws/xray/EIPTracingTest.java   |   4 +-
 .../component/aws/xray/ErrorHandlingTest.java      |  12 +-
 .../apache/camel/component/aws/xray/ErrorTest.java |  10 +-
 .../aws/xray/MulticastParallelRouteTest.java       |   9 +-
 .../component/aws/xray/MulticastRouteTest.java     |   9 +-
 .../apache/camel/component/aws/xray/TestUtils.java |   2 +
 .../camel/component/aws/xray/TwoService2Test.java  |   2 +-
 .../camel/component/aws/xray/TwoServiceTest.java   |   2 +-
 .../aws/xray/TwoServiceWithExcludeTest.java        |   2 +-
 20 files changed, 342 insertions(+), 44 deletions(-)

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 4921e92..d019fea 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
@@ -28,6 +28,8 @@ import org.apache.camel.spi.InterceptStrategy;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import static org.apache.camel.component.aws.xray.XRayTracer.sanitizeName;
+
 public class EIPTracingStrategy implements InterceptStrategy {
 
     private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
@@ -41,7 +43,7 @@ public class EIPTracingStrategy implements InterceptStrategy {
 
         return new DelegateAsyncProcessor((Exchange exchange) -> {
             LOG.trace("Creating new subsegment for {} - EIP {}", defName, target);
-            Subsegment subsegment = AWSXRay.beginSubsegment(defName);
+            Subsegment subsegment = AWSXRay.beginSubsegment(sanitizeName(defName));
             try {
                 LOG.trace("Processing EIP {}", target);
                 target.process(exchange);
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 8afbd6b..0229d80 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
@@ -33,6 +33,8 @@ import org.apache.camel.spi.InterceptStrategy;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import static org.apache.camel.component.aws.xray.XRayTracer.sanitizeName;
+
 public class TraceAnnotatedTracingStrategy implements InterceptStrategy {
 
     private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
@@ -44,6 +46,7 @@ public class TraceAnnotatedTracingStrategy implements InterceptStrategy {
         throws Exception {
 
         Class<?> processorClass = processorDefinition.getClass();
+        String shortName = processorDefinition.getShortName();
 
         if (processorDefinition instanceof BeanDefinition) {
             BeanProcessor beanProcessor = (BeanProcessor) nextTarget;
@@ -72,11 +75,11 @@ public class TraceAnnotatedTracingStrategy implements InterceptStrategy {
         }
 
         final Class<?> type = processorClass;
-        final String name = metricName;
+        final String name = shortName + ":" + metricName;
 
         return new DelegateAsyncProcessor((Exchange exchange) -> {
             LOG.trace("Creating new subsegment for {} of type {} - EIP {}", name, type, target);
-            Subsegment subsegment = AWSXRay.beginSubsegment(name);
+            Subsegment subsegment = AWSXRay.beginSubsegment(sanitizeName(name));
             try {
                 LOG.trace("Processing EIP {}", target);
                 target.process(exchange);
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 d6dcae2..b18a560 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
@@ -86,6 +86,7 @@ public class XRayTracer extends ServiceSupport implements RoutePolicyFactory, St
             // Add segment decorator only if no existing decorator for the component exists yet or if we have have a
             // derived one. This allows custom decorators to be added if they extend the standard decorators
             if (existing == null || existing.getClass().isInstance(d)) {
+                LOG.trace("Adding segment decorator {}", d.getComponent());
                 decorators.put(d.getComponent(), d);
             }
         });
@@ -266,9 +267,13 @@ public class XRayTracer extends ServiceSupport implements RoutePolicyFactory, St
                 }
 
                 if (AWSXRay.getCurrentSegmentOptional().isPresent()) {
-//                    // AWS XRay does only allow a certain set of characters to appear within a name
-//                    // Allowed characters: a-z, A-Z, 0-9, _, ., :, /, %, &, #, =, +, \, -, @
-                    Subsegment subsegment = AWSXRay.beginSubsegment(sd.getOperationName(ese.getExchange(), ese.getEndpoint()));
+                    // AWS XRay does only allow a certain set of characters to appear within a name
+                    // Allowed characters: a-z, A-Z, 0-9, _, ., :, /, %, &, #, =, +, \, -, @
+                    String name = sd.getOperationName(ese.getExchange(), ese.getEndpoint());
+                    if (sd.getComponent() != null) {
+                        name = sd.getComponent() + ":" + name;
+                    }
+                    Subsegment subsegment = AWSXRay.beginSubsegment(sanitizeName(name));
                     sd.pre(subsegment, ese.getExchange(), ese.getEndpoint());
                     LOG.trace("Creating new subsegment with ID {} and name {}",
                             subsegment.getId(), subsegment.getName());
@@ -350,7 +355,7 @@ public class XRayTracer extends ServiceSupport implements RoutePolicyFactory, St
 
             SegmentDecorator sd = getSegmentDecorator(route.getEndpoint());
             if (!AWSXRay.getCurrentSegmentOptional().isPresent()) {
-                Segment segment = AWSXRay.beginSegment(route.getId());
+                Segment segment = AWSXRay.beginSegment(sanitizeName(route.getId()));
                 segment.setTraceId(traceID);
                 sd.pre(segment, exchange, route.getEndpoint());
                 LOG.trace("Created new XRay segment {} with name {}",
@@ -394,4 +399,17 @@ public class XRayTracer extends ServiceSupport implements RoutePolicyFactory, St
             return "XRayRoutePolicy";
         }
     }
+
+    /**
+     * Removes invalid characters from AWS XRay (sub-)segment names and replaces the invalid characters with an
+     * underscore character.
+     *
+     * @param name The name to assign to an AWS XRay (sub-)segment
+     * @return The sanitized name of the (sub-)segment
+     */
+    public static String sanitizeName(String name) {
+        // Allowed characters: a-z, A-Z, 0-9, _, ., :, /, %, &, #, =, +, \, -, @
+        // \w = a-zA-Z0-9_
+        return name.replaceAll("[^\\w.:/%&#=+\\-@]", "_");
+    }
 }
\ No newline at end of file
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/AbstractSegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/AbstractSegmentDecorator.java
index f5403a5..5d58f55 100644
--- a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/AbstractSegmentDecorator.java
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/AbstractSegmentDecorator.java
@@ -40,7 +40,7 @@ public abstract class AbstractSegmentDecorator implements SegmentDecorator {
     @Override
     public String getOperationName(Exchange exchange, Endpoint endpoint) {
         URI uri = URI.create(endpoint.getEndpointUri());
-        return uri.getScheme() + "-" + uri.getRawAuthority();
+        return uri.getScheme() + ":" + uri.getRawAuthority();
     }
 
     @Override
diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/JdbcSegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/JdbcSegmentDecorator.java
index 43b0146..2dbf994 100644
--- a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/JdbcSegmentDecorator.java
+++ b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/JdbcSegmentDecorator.java
@@ -35,7 +35,7 @@ public class JdbcSegmentDecorator extends AbstractSegmentDecorator {
 
         Object body = exchange.getIn().getBody();
         if (body instanceof String) {
-            segment.putMetadata("db.statement", body);
+            segment.putSql("db.statement", body);
         }
     }
 }
diff --git a/components/camel-aws-xray/src/main/resources/META-INF/LICENSE.txt b/components/camel-aws-xray/src/main/resources/META-INF/LICENSE.txt
new file mode 100644
index 0000000..6b0b127
--- /dev/null
+++ b/components/camel-aws-xray/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/components/camel-aws-xray/src/main/resources/META-INF/NOTICE.txt b/components/camel-aws-xray/src/main/resources/META-INF/NOTICE.txt
new file mode 100644
index 0000000..2e215bf
--- /dev/null
+++ b/components/camel-aws-xray/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/components/camel-aws-xray/src/main/resources/META-INF/services/org.apache.camel.component.aws.xray.SegmentDecorator b/components/camel-aws-xray/src/main/resources/META-INF/services/org.apache.camel.component.aws.xray.SegmentDecorator
new file mode 100644
index 0000000..3ab9a57
--- /dev/null
+++ b/components/camel-aws-xray/src/main/resources/META-INF/services/org.apache.camel.component.aws.xray.SegmentDecorator
@@ -0,0 +1,56 @@
+#
+# 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.
+#
+
+org.apache.camel.component.aws.xray.decorators.CqlSegmentDecorator
+org.apache.camel.component.aws.xray.decorators.ElasticsearchSegmentDecorator
+org.apache.camel.component.aws.xray.decorators.JdbcSegmentDecorator
+org.apache.camel.component.aws.xray.decorators.LogSegmentDecorator
+org.apache.camel.component.aws.xray.decorators.MongoDBSegmentDecorator
+org.apache.camel.component.aws.xray.decorators.SqlSegmentDecorator
+org.apache.camel.component.aws.xray.decorators.TimerSegmentDecorator
+
+org.apache.camel.component.aws.xray.decorators.http.AhcSegmentDecorator
+org.apache.camel.component.aws.xray.decorators.http.Http4SegmentDecorator
+org.apache.camel.component.aws.xray.decorators.http.HttpSegmentDecorator
+org.apache.camel.component.aws.xray.decorators.http.JettySegmentDecorator
+org.apache.camel.component.aws.xray.decorators.http.NettyHttp4SegmentDecorator
+org.apache.camel.component.aws.xray.decorators.http.NettyHttpSegmentDecorator
+org.apache.camel.component.aws.xray.decorators.http.RestletSegmentDecorator
+org.apache.camel.component.aws.xray.decorators.http.RestSegmentDecorator
+org.apache.camel.component.aws.xray.decorators.http.ServletSegmentDecorator
+org.apache.camel.component.aws.xray.decorators.http.UndertowSegmentDecorator
+
+org.apache.camel.component.aws.xray.decorators.internal.DirectSegmentDecorator
+org.apache.camel.component.aws.xray.decorators.internal.DirectvmSegmentDecorator
+org.apache.camel.component.aws.xray.decorators.internal.DisruptorSegmentDecorator
+org.apache.camel.component.aws.xray.decorators.internal.DisruptorvmSegmentDecorator
+org.apache.camel.component.aws.xray.decorators.internal.SedaSegmentDecorator
+org.apache.camel.component.aws.xray.decorators.internal.VmSegmentDecorator
+
+org.apache.camel.component.aws.xray.decorators.messaging.AmqpSegmentDecorator
+org.apache.camel.component.aws.xray.decorators.messaging.AwsSnsSegmentDecorator
+org.apache.camel.component.aws.xray.decorators.messaging.AwsSqsSegmentDecorator
+org.apache.camel.component.aws.xray.decorators.messaging.CometdSegmentDecorator
+org.apache.camel.component.aws.xray.decorators.messaging.CometdsSegmentDecorator
+org.apache.camel.component.aws.xray.decorators.messaging.IronmqSegmentDecorator
+org.apache.camel.component.aws.xray.decorators.messaging.JmsSegmentDecorator
+org.apache.camel.component.aws.xray.decorators.messaging.KafkaSegmentDecorator
+org.apache.camel.component.aws.xray.decorators.messaging.MqttSegmentDecorator
+org.apache.camel.component.aws.xray.decorators.messaging.PahoSegmentDecorator
+org.apache.camel.component.aws.xray.decorators.messaging.RabbitmqSegmentDecorator
+org.apache.camel.component.aws.xray.decorators.messaging.SjmsSegmentDecorator
+org.apache.camel.component.aws.xray.decorators.messaging.StompSegmentDecorator
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 5f9f493..87b7a47 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
@@ -25,16 +25,17 @@ public class ABCRouteTest extends CamelAwsXRayTestSupport {
         super(
             TestDataBuilder.createTrace().inRandomOrder()
                 .withSegment(TestDataBuilder.createSegment("start")
-                    .withSubsegment(TestDataBuilder.createSubsegment("direct-a")
+                    .withSubsegment(TestDataBuilder.createSubsegment("direct:a")
                         .withSubsegment(TestDataBuilder.createSubsegment("a")
-                            .withSubsegment(TestDataBuilder.createSubsegment("seda-b"))
-                            .withSubsegment(TestDataBuilder.createSubsegment("seda-c"))
+                            .withSubsegment(TestDataBuilder.createSubsegment("seda:b"))
+                            .withSubsegment(TestDataBuilder.createSubsegment("seda:c"))
                         )
                     )
                 )
                 .withSegment(TestDataBuilder.createSegment("b"))
                 .withSegment(TestDataBuilder.createSegment("c")
-                    .withSubsegment(TestDataBuilder.createSubsegment("log-test"))
+                        // disabled by the LogSegmentDecorator (-> .to("log:..."); .log("...") is still working)
+                        //.withSubsegment(TestDataBuilder.createSubsegment("log:test"))
                 )
                 .withSegment(TestDataBuilder.createSegment("d"))
         );
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 f4213ee..26f7547 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
@@ -33,14 +33,14 @@ public class BeanTracingTest extends CamelAwsXRayTestSupport {
         super(
             TestDataBuilder.createTrace()
                 .withSegment(TestDataBuilder.createSegment("start")
-                    .withSubsegment(TestDataBuilder.createSubsegment("TraceBean"))
-                    .withSubsegment(TestDataBuilder.createSubsegment("seda-otherRoute"))
-                    .withSubsegment(TestDataBuilder.createSubsegment("mock-end"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("bean:TraceBean"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("seda:otherRoute"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("mock:end"))
                     .withAnnotation("body", "HELLO")
                     .withMetadata("originBody", "Hello")
                 )
                 .withSegment(TestDataBuilder.createSegment("otherRoute")
-                    .withSubsegment(TestDataBuilder.createSubsegment("processor"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("process:processor"))
                 )
         );
     }
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 dda8865..24881e0 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
@@ -25,9 +25,9 @@ public class ClientRecipientListRouteTest extends CamelAwsXRayTestSupport {
         super(
             TestDataBuilder.createTrace().inRandomOrder()
                 .withSegment(TestDataBuilder.createSegment("start")
-                    .withSubsegment(TestDataBuilder.createSubsegment("seda-a"))
-                    .withSubsegment(TestDataBuilder.createSubsegment("seda-b"))
-                    .withSubsegment(TestDataBuilder.createSubsegment("seda-c"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("seda:a"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("seda:b"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("seda:c"))
                 )
                 .withSegment(TestDataBuilder.createSegment("a"))
                 .withSegment(TestDataBuilder.createSegment("b"))
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 650a072..49bfc6e 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
@@ -37,10 +37,10 @@ public class EIPTracingTest extends CamelAwsXRayTestSupport {
                     .withSubsegment(TestDataBuilder.createSubsegment("bean"))
                     .withSubsegment(TestDataBuilder.createSubsegment("delay")
                         .withSubsegment(TestDataBuilder.createSubsegment("to")
-                            .withSubsegment(TestDataBuilder.createSubsegment("seda-otherRoute"))
+                            .withSubsegment(TestDataBuilder.createSubsegment("seda:otherRoute"))
                         )
                         .withSubsegment(TestDataBuilder.createSubsegment("to")
-                            .withSubsegment(TestDataBuilder.createSubsegment("mock-end"))
+                            .withSubsegment(TestDataBuilder.createSubsegment("mock:end"))
                         )
                     )
                     .withAnnotation("body", "HELLO")
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 e351684..eb74e5b 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
@@ -39,15 +39,15 @@ public class ErrorHandlingTest extends CamelAwsXRayTestSupport {
         super(
             TestDataBuilder.createTrace()
                 .withSegment(TestDataBuilder.createSegment("start")
-                        .withSubsegment(TestDataBuilder.createSubsegment("TraceBean"))
+                        .withSubsegment(TestDataBuilder.createSubsegment("bean:TraceBean"))
 //                      .withSubsegment(TestDataBuilder.createSubsegment("ExceptionRetryProcessor"))
-                        .withSubsegment(TestDataBuilder.createSubsegment("TraceBean"))
+                        .withSubsegment(TestDataBuilder.createSubsegment("bean:TraceBean"))
 //                      .withSubsegment(TestDataBuilder.createSubsegment("ExceptionRetryProcessor"))
-                        .withSubsegment(TestDataBuilder.createSubsegment("TraceBean"))
+                        .withSubsegment(TestDataBuilder.createSubsegment("bean:TraceBean"))
 //                      .withSubsegment(TestDataBuilder.createSubsegment("ExceptionRetryProcessor"))
-                        .withSubsegment(TestDataBuilder.createSubsegment("TraceBean"))
-                        .withSubsegment(TestDataBuilder.createSubsegment("seda-otherRoute"))
-                        .withSubsegment(TestDataBuilder.createSubsegment("mock-end"))
+                        .withSubsegment(TestDataBuilder.createSubsegment("bean:TraceBean"))
+                        .withSubsegment(TestDataBuilder.createSubsegment("seda:otherRoute"))
+                        .withSubsegment(TestDataBuilder.createSubsegment("mock:end"))
                 )
                 .withSegment(TestDataBuilder.createSegment("otherRoute"))
         );
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 992c83a..3aebce3 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
@@ -38,11 +38,11 @@ public class ErrorTest extends CamelAwsXRayTestSupport {
         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"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("bean:TraceBean"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("bean:TraceBean"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("bean:TraceBean"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("bean:TraceBean"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("process:ExceptionProcessor"))
                 )
         );
     }
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 25c60c3..1c83f1b 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
@@ -25,15 +25,16 @@ public class MulticastParallelRouteTest extends CamelAwsXRayTestSupport {
         super(
             TestDataBuilder.createTrace().inRandomOrder()
                 .withSegment(TestDataBuilder.createSegment("start")
-                    .withSubsegment(TestDataBuilder.createSubsegment("seda-a"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("seda:a"))
                 )
                 .withSegment(TestDataBuilder.createSegment("a").inRandomOrder()
-                    .withSubsegment(TestDataBuilder.createSubsegment("seda-b"))
-                    .withSubsegment(TestDataBuilder.createSubsegment("seda-c"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("seda:b"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("seda:c"))
                 )
                 .withSegment(TestDataBuilder.createSegment("b"))
                 .withSegment(TestDataBuilder.createSegment("c")
-                    .withSubsegment(TestDataBuilder.createSubsegment("log-routing%20at%20$%7BrouteId%7D"))
+                        // disabled by the LogSegmentDecorator (-> .to("log:..."); .log("...") is still working)
+                        //.withSubsegment(TestDataBuilder.createSubsegment("log:routing%20at%20$%7BrouteId%7D"))
                 )
         );
     }
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 f8f4714..cf32331 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
@@ -25,15 +25,16 @@ public class MulticastRouteTest extends CamelAwsXRayTestSupport {
         super(
             TestDataBuilder.createTrace()
                 .withSegment(TestDataBuilder.createSegment("start")
-                    .withSubsegment(TestDataBuilder.createSubsegment("seda-a"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("seda:a"))
                 )
                 .withSegment(TestDataBuilder.createSegment("a")
-                    .withSubsegment(TestDataBuilder.createSubsegment("seda-b"))
-                    .withSubsegment(TestDataBuilder.createSubsegment("seda-c"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("seda:b"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("seda:c"))
                 )
                 .withSegment(TestDataBuilder.createSegment("b"))
                 .withSegment(TestDataBuilder.createSegment("c")
-                    .withSubsegment(TestDataBuilder.createSubsegment("log-routing%20at%20$%7BrouteId%7D"))
+                        // disabled by the LogSegmentDecorator (-> .to("log:..."); .log("...") is still working)
+                        //.withSubsegment(TestDataBuilder.createSubsegment("log:routing%20at%20$%7BrouteId%7D"))
                 )
         );
     }
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 bd3933d..67cf2d8 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
@@ -87,6 +87,8 @@ public final class TestUtils {
             } else {
                 for (int i = 0; i < expected.getSubsegments().size(); i++) {
                     if (actual.getName().equals(expected.getName())) {
+                        assertThat("An expected subsegment is missing in the actual payload of segment " + actual.getName(),
+                                actual.getSubsegments().size(), is(greaterThanOrEqualTo(expected.getSubsegments().size())));
                         verifySubsegments(expected.getSubsegments().get(i), actual.getSubsegments().get(i));
                     }
                 }
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 e27b67c..f82cd52 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
@@ -26,7 +26,7 @@ public class TwoService2Test extends CamelAwsXRayTestSupport {
         super(
             TestDataBuilder.createTrace().inRandomOrder()
                 .withSegment(TestDataBuilder.createSegment("route1")
-                    .withSubsegment(TestDataBuilder.createSubsegment("direct-ServiceB")
+                    .withSubsegment(TestDataBuilder.createSubsegment("direct:ServiceB")
                         .withSubsegment(TestDataBuilder.createSubsegment("route2"))
                     )
                 )
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 ffc45a1..a490be8 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
@@ -26,7 +26,7 @@ public class TwoServiceTest extends CamelAwsXRayTestSupport {
         super(
             TestDataBuilder.createTrace().inRandomOrder()
                 .withSegment(TestDataBuilder.createSegment("ServiceA")
-                    .withSubsegment(TestDataBuilder.createSubsegment("direct-ServiceB")
+                    .withSubsegment(TestDataBuilder.createSubsegment("direct:ServiceB")
                         .withSubsegment(TestDataBuilder.createSubsegment("ServiceB"))
                     )
                 )
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 5c41078..96a0d82 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
@@ -28,7 +28,7 @@ public class TwoServiceWithExcludeTest extends CamelAwsXRayTestSupport {
         super(
             TestDataBuilder.createTrace().inRandomOrder()
                 .withSegment(TestDataBuilder.createSegment("ServiceA")
-                    .withSubsegment(TestDataBuilder.createSubsegment("direct-ServiceB"))
+                    .withSubsegment(TestDataBuilder.createSubsegment("direct:ServiceB"))
                 )
         );
     }

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

[camel] 08/08: Regen after AWS Xray component merge

Posted by ac...@apache.org.
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 2df9fdb20d8069daa8ca4899bd2a2305a93e7e21
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Nov 29 15:30:50 2017 +0100

    Regen after AWS Xray component merge
---
 components/readme.adoc         | 4 +++-
 docs/user-manual/en/SUMMARY.md | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/components/readme.adoc b/components/readme.adoc
index 9b76c11..bde02f9 100644
--- a/components/readme.adoc
+++ b/components/readme.adoc
@@ -1044,7 +1044,7 @@ Miscellaneous Components
 ^^^^^^^^^^^^^^^^^^^^^^^^
 
 // others: START
-Number of Miscellaneous Components: 37 in 37 JAR artifacts (13 deprecated)
+Number of Miscellaneous Components: 38 in 38 JAR artifacts (13 deprecated)
 
 [width="100%",cols="4,1,5",options="header"]
 |===
@@ -1122,6 +1122,8 @@ Number of Miscellaneous Components: 37 in 37 JAR artifacts (13 deprecated)
 
 | link:camel-urlrewrite/src/main/docs/urlrewrite.adoc[URLRewrite] (camel-urlrewrite) | 2.11 | *deprecated* URL rewrite support for HTTP components
 
+| link:camel-aws-xray/src/main/docs/aws-xray.adoc[XRay] (camel-aws-xray) | 2.21 | Distributed tracing using AWS XRay
+
 | link:camel-zipkin/src/main/docs/zipkin.adoc[Zipkin] (camel-zipkin) | 2.18 | Distributed message tracing using Zipkin
 |===
 // others: END
diff --git a/docs/user-manual/en/SUMMARY.md b/docs/user-manual/en/SUMMARY.md
index b1dc1ca..c272613 100644
--- a/docs/user-manual/en/SUMMARY.md
+++ b/docs/user-manual/en/SUMMARY.md
@@ -428,6 +428,7 @@
 	* [Test Spring](test-spring.adoc)
 	* [TestNG](testng.adoc)
 	* [URLRewrite](urlrewrite.adoc)
+	* [XRay](aws-xray.adoc)
 	* [Zipkin](zipkin.adoc)
 <!-- others: END -->
 

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

[camel] 04/08: Replaced org.json library with a self-written JSON parser due to imcompatibilities with the Apache 2.0 licence

Posted by ac...@apache.org.
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 2cdaa43634ab1c5c58ef5c6720064d04bbea61ea
Author: Roman Vottner <ro...@gmx.at>
AuthorDate: Wed Nov 1 13:45:11 2017 +0100

    Replaced org.json library with a self-written JSON parser due to imcompatibilities with the Apache 2.0 licence
---
 components/camel-aws-xray/pom.xml                  |   6 +-
 .../camel/component/aws/xray/FakeAWSDaemon.java    |  85 +++++-----
 .../camel/component/aws/xray/json/JsonArray.java   |  23 +++
 .../camel/component/aws/xray/json/JsonObject.java  |  93 +++++++++++
 .../camel/component/aws/xray/json/JsonParser.java  | 154 ++++++++++++++++++
 .../component/aws/xray/json/JsonStructure.java     |  22 +++
 .../camel/component/aws/xray/json/JsonTest.java    | 174 +++++++++++++++++++++
 7 files changed, 510 insertions(+), 47 deletions(-)

diff --git a/components/camel-aws-xray/pom.xml b/components/camel-aws-xray/pom.xml
index b440d7d..c859aaa 100644
--- a/components/camel-aws-xray/pom.xml
+++ b/components/camel-aws-xray/pom.xml
@@ -91,9 +91,9 @@
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>org.json</groupId>
-      <artifactId>json</artifactId>
-      <version>20170516</version>
+      <groupId>commons-lang</groupId>
+      <artifactId>commons-lang</artifactId>
+      <version>2.6</version>
       <scope>test</scope>
     </dependency>
 
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 676929d..4e8ea91 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
@@ -28,13 +28,15 @@ import java.util.Map;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.TimeUnit;
+
 import org.apache.camel.component.aws.xray.TestDataBuilder.TestEntity;
 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 org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
+import org.apache.camel.component.aws.xray.json.JsonArray;
+import org.apache.camel.component.aws.xray.json.JsonObject;
+import org.apache.camel.component.aws.xray.json.JsonParser;
+import org.apache.commons.lang.StringUtils;
 import org.junit.rules.ExternalResource;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -95,8 +97,8 @@ public class FakeAWSDaemon extends ExternalResource {
                 serverSocket = new DatagramSocket(2000);
 
                 StringBuilder sb = new StringBuilder();
-                byte[] receiveData = new byte[8096];
                 while (!done) {
+                    byte[] receiveData = new byte[2048];
                     DatagramPacket receivedPacket = new DatagramPacket(receiveData, receiveData.length);
                     serverSocket.receive(receivedPacket);
 
@@ -105,17 +107,26 @@ public class FakeAWSDaemon extends ExternalResource {
 
                     String locSegment = null;
                     try {
-                        String raw = sb.toString();
+                        String raw = sb.toString().trim();
                         String[] segments = raw.split("\\n");
                         for (String segment : segments) {
                             locSegment = segment;
                             LOG.trace("Processing received segment: {}", segment);
                             if (!"".equals(segment)) {
+                                if (!segment.endsWith("}")
+                                        || StringUtils.countMatches(segment, "{") != StringUtils.countMatches(segment, "}")
+                                        || StringUtils.countMatches(segment, "[") != StringUtils.countMatches(segment, "]")) {
+                                    LOG.trace("Skipping incomplete content: {}", segment);
+                                    continue;
+                                }
                                 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);
+                                    // clean the JSON string received
+                                    LOG.trace("Original JSON content: {}", segment);
+                                    locSegment = segment;
+                                    JsonObject json = (JsonObject) JsonParser.parse(segment);
                                     String traceId = json.getString("trace_id");
                                     TestTrace testTrace = receivedTraces.get(traceId);
                                     if (null == testTrace) {
@@ -131,8 +142,8 @@ public class FakeAWSDaemon extends ExternalResource {
                             }
                         }
                         LOG.trace("Item {} received. JSON content: {}, Raw: {}",
-                            receivedTraces.size(), receivedTraces, raw);
-                    } catch (JSONException jsonEx) {
+                                receivedTraces.size(), receivedTraces, raw);
+                    } catch (Exception jsonEx) {
                         LOG.warn("Could not convert segment " + locSegment + " to a Java object", jsonEx);
                     }
                 }
@@ -143,12 +154,12 @@ public class FakeAWSDaemon extends ExternalResource {
             }
         }
 
-        private TestSegment convertData(JSONObject json) {
+        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");
+                JsonArray jsonSubsegments = (JsonArray) json.get("subsegments");
                 List<TestSubsegment> subsegments = convertSubsegments(jsonSubsegments);
                 for (TestSubsegment subsegment : subsegments) {
                     segment.withSubsegment(subsegment);
@@ -159,19 +170,19 @@ public class FakeAWSDaemon extends ExternalResource {
             return segment;
         }
 
-        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);
+        private List<TestSubsegment> convertSubsegments(JsonArray jsonSubsegments) {
+            List<TestSubsegment> subsegments = new ArrayList<>(jsonSubsegments.size());
+            for (int i = 0; i < jsonSubsegments.size(); i++) {
+                JsonObject jsonSubsegment = jsonSubsegments.toArray(new JsonObject[jsonSubsegments.size()])[i];
                 subsegments.add(convertSubsegment(jsonSubsegment));
             }
             return subsegments;
         }
 
-        private TestSubsegment convertSubsegment(JSONObject json) {
-            TestSubsegment subsegment = new TestSubsegment(json.getString("name"));
+        private TestSubsegment convertSubsegment(JsonObject json) {
+            TestSubsegment subsegment = new TestSubsegment((String)json.get("name"));
             if (json.has("subsegments")) {
-                List<TestSubsegment> subsegments = convertSubsegments(json.getJSONArray("subsegments"));
+                List<TestSubsegment> subsegments = convertSubsegments((JsonArray) json.get("subsegments"));
                 for (TestSubsegment tss : subsegments) {
                     subsegment.withSubsegment(tss);
                 }
@@ -181,18 +192,19 @@ public class FakeAWSDaemon extends ExternalResource {
             return subsegment;
         }
 
-        private void addAnnotationsIfAvailable(TestEntity<?> entity, JSONObject json) {
+        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));
+                JsonObject annotations = (JsonObject) json.get("annotations");
+                for (String key : annotations.getKeys()) {
+                    entity.withAnnotation((String)key, annotations.get(key));
                 }
             }
         }
 
-        private void addMetadataIfAvailable(TestEntity<?> entity, JSONObject json) {
+        private void addMetadataIfAvailable(TestEntity<?> entity, JsonObject json) {
             if (json.has("metadata")) {
-                Map<String, Map<String, Object>> metadata = parseMetadata(json.getJSONObject("metadata"));
+                JsonObject rawMetadata = (JsonObject) json.get("metadata");
+                Map<String, Map<String, Object>> metadata = parseMetadata(rawMetadata);
                 for (String namespace : metadata.keySet()) {
                     for (String key : metadata.get(namespace).keySet()) {
                         entity.withMetadata(namespace, key, metadata.get(namespace).get(key));
@@ -201,22 +213,7 @@ public class FakeAWSDaemon extends ExternalResource {
             }
         }
 
-        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) {
+        private Map<String, Map<String, Object>> parseMetadata(JsonObject json) {
             /*
              "metadata" : {
                 "default" : {
@@ -227,13 +224,13 @@ public class FakeAWSDaemon extends ExternalResource {
                 }
              }
              */
-            Map<String, Map<String, Object>> metadata = new LinkedHashMap<>(json.keySet().size());
-            for (String namespace : json.keySet()) {
-                JSONObject namespaceData = json.getJSONObject(namespace);
+            Map<String, Map<String, Object>> metadata = new LinkedHashMap<>(json.getKeys().size());
+            for (String namespace : json.getKeys()) {
+                JsonObject namespaceData = (JsonObject) json.get(namespace);
                 if (!metadata.containsKey(namespace)) {
-                    metadata.put(namespace, new LinkedHashMap<>(namespaceData.keySet().size()));
+                    metadata.put(namespace, new LinkedHashMap<>(namespaceData.getKeys().size()));
                 }
-                for (String key : namespaceData.keySet()) {
+                for (String key : namespaceData.getKeys()) {
                     metadata.get(namespace).put(key, namespaceData.get(key));
                 }
             }
diff --git a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/json/JsonArray.java b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/json/JsonArray.java
new file mode 100644
index 0000000..3d00ddc
--- /dev/null
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/json/JsonArray.java
@@ -0,0 +1,23 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.json;
+
+import java.util.ArrayList;
+
+public class JsonArray extends ArrayList<JsonStructure> implements JsonStructure {
+
+}
diff --git a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/json/JsonObject.java b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/json/JsonObject.java
new file mode 100644
index 0000000..6698607
--- /dev/null
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/json/JsonObject.java
@@ -0,0 +1,93 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.json;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Set;
+
+public class JsonObject implements JsonStructure {
+
+    private Map<String, Object> data = new LinkedHashMap<>();
+
+    void addElement(String key, Object value) {
+        data.put(key, value);
+    }
+
+    public Object get(String key) {
+        return data.get(key);
+    }
+
+    public Set<String> getKeys() {
+        return data.keySet();
+    }
+
+    public boolean has(String key) {
+        return data.containsKey(key);
+    }
+
+    public String getString(String key) {
+        if (data.containsKey(key) && null != data.get(key)) {
+            return data.get(key).toString();
+        }
+        return null;
+    }
+
+    public Double getDouble(String key) {
+        if (data.containsKey(key) && null != data.get(key)) {
+            Object value = data.get(key);
+            if (value instanceof String) {
+                return Double.valueOf((String) value);
+            }
+            return (Double) value;
+        }
+        return 0D;
+    }
+
+    public Long getLong(String key) {
+        if (data.containsKey(key) && null != data.get(key)) {
+            Object value = data.get(key);
+            if (value instanceof String) {
+                return Long.valueOf((String) value);
+            }
+            return (Long) value;
+        }
+        return 0L;
+    }
+
+    public Integer getInteger(String key) {
+        if (data.containsKey(key) && null != data.get(key)) {
+            Object value = data.get(key);
+            if (value instanceof String) {
+                return Integer.valueOf((String) value);
+            }
+            return (Integer) value;
+        }
+        return 0;
+    }
+
+    public Boolean getBoolean(String key) {
+        if (data.containsKey(key) && null != data.get(key)) {
+            Object value = data.get(key);
+            if (value instanceof String) {
+                return Boolean.valueOf((String) value);
+            }
+            return (Boolean) value;
+        }
+        return null;
+    }
+}
diff --git a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/json/JsonParser.java b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/json/JsonParser.java
new file mode 100644
index 0000000..13acf93
--- /dev/null
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/json/JsonParser.java
@@ -0,0 +1,154 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.json;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Stack;
+
+import org.apache.commons.lang.StringUtils;
+
+public final class JsonParser {
+
+    private JsonParser() {
+
+    }
+
+    public static JsonStructure parse(final String jsonString) {
+        String json = jsonString.replaceAll("\n", "");
+
+        Stack<JsonStructure> stack = new Stack<>();
+
+        JsonStructure ret = null;
+        List<String> doNotIncludeSymbols = Arrays.asList(",", ":", "\"");
+        StringBuilder curToken = new StringBuilder();
+        String keyName = null;
+        boolean inWord =  false;
+        for (char c : json.toCharArray()) {
+            // CHECKSTYLE:OFF
+            // fallthrough is intended here and as this is only a helper class for tests (as the previously used
+            // org.json classes are incompatible with Apache 2.0 license) formatting rules shouldn't be that strict IMO
+            // Note that the fall-through was the only rant checkstyle generated, so everything else should follow these
+            // guidelines
+            switch (c) {
+            case '{':
+                if (!inWord) {
+                    // JsonObject begin
+                    JsonObject newNode = new JsonObject();
+                    addJson(newNode, keyName, stack);
+                    keyName = null;
+                    stack.push(newNode);
+                    break;
+                }
+            case '}':
+                if (!inWord) {
+                    // JsonObject end
+                    if (!stack.isEmpty()) {
+                        ret = stack.pop();
+                    }
+                    if (keyName != null) {
+                        if (ret instanceof JsonObject) {
+                            ((JsonObject) ret).addElement(sanitizeKey(keyName), sanitizeData(curToken.toString()));
+                            keyName = null;
+                            curToken.delete(0, curToken.length());
+                        }
+                    }
+                    break;
+                }
+            case '[':
+                if (!inWord) {
+                    // JsonArray start
+                    JsonArray newArray = new JsonArray();
+                    addJson(newArray, keyName, stack);
+                    keyName = null;
+                    stack.push(newArray);
+                    break;
+                }
+            case ']':
+                if (!inWord) {
+                    // JsonArray end
+                    if (!stack.isEmpty()) {
+                        ret = stack.pop();
+                    }
+                    break;
+                }
+            case ':':
+                if (!inWord) {
+                    // Element start
+                    keyName = curToken.toString();
+                    curToken.delete(0, curToken.length());
+                    break;
+                }
+            case ',':
+                if (!inWord) {
+                    // Element separator
+                    if (keyName != null) {
+                        JsonObject jsonObj = (JsonObject) stack.peek();
+                        jsonObj.addElement(sanitizeKey(keyName), sanitizeData(curToken.toString()));
+                    }
+                    curToken.delete(0, curToken.length());
+                    keyName = null;
+                    break;
+                }
+            default:
+                if (('"' == c && curToken.length() == 0)
+                        || ('"' == c && curToken.length() > 0 && curToken.charAt(curToken.length() - 1) != '\\')) {
+                    inWord = !inWord;
+                }
+                if (!inWord && !doNotIncludeSymbols.contains("" + c)) {
+                    curToken.append(c);
+                } else if ('"' != c || (curToken.length() > 0 && curToken.charAt(curToken.length() - 1) == '\\')) {
+                    curToken.append(c);
+                }
+            }
+            // CHECKSTYLE:ON
+        }
+        return ret;
+    }
+
+    private static void addJson(JsonStructure element, String key, Stack<JsonStructure> stack) {
+        if (!stack.isEmpty()) {
+            JsonStructure json = stack.peek();
+            if (json instanceof JsonObject && key != null) {
+                ((JsonObject)json).addElement(sanitizeKey(key), element);
+            } else if (json instanceof JsonArray) {
+                ((JsonArray)json).add(element);
+            }
+        }
+    }
+
+    private static String sanitizeKey(String key) {
+        return key.trim();
+    }
+
+    private static Object sanitizeData(String data) {
+        data = data.trim();
+        if (data.toLowerCase().equals("true") || data.toLowerCase().equals("false")) {
+            return Boolean.valueOf(data);
+        }
+        if (data.contains(".") && StringUtils.countMatches(data, ".") == 1 && data.matches("[0-9\\.]+")) {
+            return Double.valueOf(data);
+        } else if (data.matches("[0-9]+")) {
+            try {
+                return Integer.valueOf(data);
+            } catch (NumberFormatException nfEx) {
+                return Long.valueOf(data);
+            }
+        }
+        return data;
+    }
+}
diff --git a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/json/JsonStructure.java b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/json/JsonStructure.java
new file mode 100644
index 0000000..81daa3a
--- /dev/null
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/json/JsonStructure.java
@@ -0,0 +1,22 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.json;
+
+interface JsonStructure {
+
+
+}
diff --git a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/json/JsonTest.java b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/json/JsonTest.java
new file mode 100644
index 0000000..10c5138
--- /dev/null
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/json/JsonTest.java
@@ -0,0 +1,174 @@
+/**
+ * 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.
+ */
+package org.apache.camel.component.aws.xray.json;
+
+import org.junit.Test;
+
+import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.core.IsNull.notNullValue;
+import static org.junit.Assert.assertThat;
+
+public class JsonTest {
+
+    @Test
+    public void testJsonParse() {
+        JsonStructure json = JsonParser.parse("{\n"
+                + "  \"test\": \"some string\",\n"
+                + "  \"otherKey\": true,\n"
+                + "  \"nextKey\": 1234,\n"
+                + "  \"doubleKey\": 1234.567,\n"
+                + "  \"subElement\": {\n"
+                + "    \"subKey\": \"some other string\",\n"
+                + "    \"complexString\": \"String with JSON syntax elements like .,\\\" { or }\"\n"
+                + "  },\n"
+                + "  \"arrayElement\": [\n"
+                + "    {\n"
+                + "      \"id\": 1,\n"
+                + "      \"name\": \"test1\"\n"
+                + "    },\n"
+                + "    {\n"
+                + "      \"id\": 2,\n"
+                + "      \"name\": \"test2\"\n"
+                + "    }\n"
+                + "  ]\n"
+                + "}");
+
+        assertThat(json, is(notNullValue()));
+        assertThat(json, is(instanceOf(JsonObject.class)));
+        JsonObject jsonObj = (JsonObject) json;
+        assertThat(jsonObj.getKeys().size(), is(equalTo(6)));
+        assertThat(jsonObj.getString("test"), is(equalTo("some string")));
+        assertThat(jsonObj.getBoolean("otherKey"), is(equalTo(true)));
+        assertThat(jsonObj.getInteger("nextKey"), is(equalTo(1234)));
+        assertThat(jsonObj.getDouble("doubleKey"), is(equalTo(1234.567)));
+        assertThat(jsonObj.get("subElement"), is(instanceOf(JsonObject.class)));
+        JsonObject jsonSub = (JsonObject) jsonObj.get("subElement");
+        assertThat(jsonSub.getString("subKey"), is(equalTo("some other string")));
+        assertThat(jsonSub.getString("complexString"), is(equalTo("String with JSON syntax elements like .,\\\" { or }")));
+        assertThat(jsonObj.get("arrayElement"), is(instanceOf(JsonArray.class)));
+        JsonArray jsonArr = (JsonArray) jsonObj.get("arrayElement");
+        assertThat(jsonArr.size(), is(equalTo(2)));
+        assertThat(jsonArr.get(0), is(instanceOf(JsonObject.class)));
+        JsonObject arrElem0 = (JsonObject) jsonArr.get(0);
+        assertThat(arrElem0.getInteger("id"), is(equalTo(1)));
+        assertThat(arrElem0.getString("name"), is(equalTo("test1")));
+        assertThat(jsonArr.get(1), is(instanceOf(JsonObject.class)));
+        JsonObject arrElem1 = (JsonObject) jsonArr.get(1);
+        assertThat(arrElem1.getInteger("id"), is(equalTo(2)));
+        assertThat(arrElem1.getString("name"), is(equalTo("test2")));
+    }
+
+    @Test
+    public void testJsonParseSample() {
+
+        JsonStructure json = JsonParser.parse("{"
+                + "  \"name\":\"b\","
+                + "  \"id\":\"6ae1778525198ce8\","
+                + "  \"start_time\":1.50947752281E9,"
+                + "  \"trace_id\":\"1-59f8cc92-4819a77b4109de34405a5643\","
+                + "  \"end_time\":1.50947752442E9,"
+                + "  \"aws\":{"
+                + "    \"xray\":{"
+                + "      \"sdk_version\":\"1.2.0\","
+                + "      \"sdk\":\"X-Ray for Java\""
+                + "    }"
+                + "  },"
+                + "  \"service\":{"
+                + "    \"runtime\":\"Java HotSpot(TM) 64-Bit Server VM\","
+                + "    \"runtime_version\":\"1.8.0_144\""
+                + "  }"
+                + "}"
+                + "}");
+
+        assertThat(json, is(notNullValue()));
+        JsonObject jsonObj = (JsonObject) json;
+        assertThat(jsonObj.getKeys().size(), is(equalTo(7)));
+        assertThat(jsonObj.getString("name"), is(equalTo("b")));
+        assertThat(jsonObj.getString("id"), is(equalTo("6ae1778525198ce8")));
+        assertThat(jsonObj.getString("trace_id"), is(equalTo("1-59f8cc92-4819a77b4109de34405a5643")));
+        assertThat(jsonObj.getDouble("start_time"), is(equalTo(1.50947752281E9)));
+        assertThat(jsonObj.getDouble("end_time"), is(equalTo(1.50947752442E9)));
+        assertThat(jsonObj.get("aws"), is(instanceOf(JsonObject.class)));
+        JsonObject aws = (JsonObject) jsonObj.get("aws");
+        assertThat(aws.get("xray"), is(instanceOf(JsonObject.class)));
+        JsonObject xray = (JsonObject) aws.get("xray");
+        assertThat(xray.getString("sdk_version"), is(equalTo("1.2.0")));
+        assertThat(xray.getString("sdk"), is(equalTo("X-Ray for Java")));
+        assertThat(jsonObj.get("service"), is(instanceOf(JsonObject.class)));
+        JsonObject service = (JsonObject) jsonObj.get("service");
+        assertThat(service.getString("runtime"), is(equalTo("Java HotSpot(TM) 64-Bit Server VM")));
+        assertThat(service.getString("runtime_version"), is(equalTo("1.8.0_144")));
+    }
+
+    @Test
+    public void testJsonParseWithArray() {
+        JsonStructure json = JsonParser.parse("{"
+                + "  \"name\":\"c\","
+                + "  \"id\":\"6ada7c7013b2c681\","
+                + "  \"start_time\":1.509484895232E9,"
+                + "  \"trace_id\":\"1-59f8e935-11c64d09c90803f69534c9af\","
+                + "  \"end_time\":1.509484901458E9,"
+                + "  \"subsegments\":["
+                + "    {"
+                + "      \"name\":\"SendingTo_log_test\","
+                + "      \"id\":\"545118f5c69e2973\","
+                + "      \"start_time\":1.509484895813E9,"
+                + "      \"end_time\":1.509484896709E9"
+                + "    }"
+                + "  ],"
+                + "  \"aws\":{"
+                + "    \"xray\":{"
+                + "      \"sdk_version\":\"1.2.0\","
+                + "      \"sdk\":\"X-Ray for Java\""
+                + "    }"
+                + "  },"
+                + "  \"service\":{"
+                + "    \"runtime\":\"Java HotSpot(TM) 64-Bit Server VM\","
+                + "    \"runtime_version\":\"1.8.0_144\""
+                + "  }"
+                + "}\u0000\u0000");
+
+        assertThat(json, is(notNullValue()));
+        JsonObject jsonObj = (JsonObject) json;
+        assertThat(jsonObj.getKeys().size(), is(equalTo(8)));
+        assertThat(jsonObj.getString("name"), is(equalTo("c")));
+        assertThat(jsonObj.getString("id"), is(equalTo("6ada7c7013b2c681")));
+        assertThat(jsonObj.getString("trace_id"), is(equalTo("1-59f8e935-11c64d09c90803f69534c9af")));
+        assertThat(jsonObj.getDouble("start_time"), is(equalTo(1.509484895232E9)));
+        assertThat(jsonObj.getDouble("end_time"), is(equalTo(1.509484901458E9)));
+        assertThat(jsonObj.get("aws"), is(instanceOf(JsonObject.class)));
+        JsonObject aws = (JsonObject) jsonObj.get("aws");
+        assertThat(aws.get("xray"), is(instanceOf(JsonObject.class)));
+        JsonObject xray = (JsonObject) aws.get("xray");
+        assertThat(xray.getString("sdk_version"), is(equalTo("1.2.0")));
+        assertThat(xray.getString("sdk"), is(equalTo("X-Ray for Java")));
+        assertThat(jsonObj.get("service"), is(instanceOf(JsonObject.class)));
+        JsonObject service = (JsonObject) jsonObj.get("service");
+        assertThat(service.getString("runtime"), is(equalTo("Java HotSpot(TM) 64-Bit Server VM")));
+        assertThat(service.getString("runtime_version"), is(equalTo("1.8.0_144")));
+        assertThat(jsonObj.get("subsegments"), is(instanceOf(JsonArray.class)));
+        JsonArray array = (JsonArray) jsonObj.get("subsegments");
+        assertThat(array.size(), is(equalTo(1)));
+        assertThat(array.get(0), is(instanceOf(JsonObject.class)));
+        JsonObject arrItem = (JsonObject) array.get(0);
+        assertThat(arrItem.getKeys().size(), is(equalTo(4)));
+        assertThat(arrItem.getString("name"), is(equalTo("SendingTo_log_test")));
+        assertThat(arrItem.getString("id"), is(equalTo("545118f5c69e2973")));
+        assertThat(arrItem.getDouble("start_time"), is(equalTo(1.509484895813E9)));
+        assertThat(arrItem.getDouble("end_time"), is(equalTo(1.509484896709E9)));
+    }
+}

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

[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

Posted by ac...@apache.org.
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>.