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 2023/01/12 09:26:34 UTC
[camel] 01/05: CAMEL-18879 - Remove Camel-Zipkin after deprecation
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 792ce8e454faf2df764c4d74522067343690e419
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Jan 12 09:47:03 2023 +0100
CAMEL-18879 - Remove Camel-Zipkin after deprecation
Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
bom/camel-bom/pom.xml | 5 -
catalog/camel-allcomponents/pom.xml | 5 -
.../org/apache/camel/catalog/CamelCatalogTest.java | 4 -
.../camel-tracing/src/main/docs/tracing.adoc | 2 +-
components/camel-zipkin/pom.xml | 121 ---
.../services/org/apache/camel/other.properties | 7 -
.../src/generated/resources/zipkin.json | 15 -
components/camel-zipkin/src/main/docs/zipkin.adoc | 289 -------
.../java/org/apache/camel/zipkin/CamelRequest.java | 52 --
.../apache/camel/zipkin/ServiceHostFunction.java | 69 --
.../apache/camel/zipkin/ServicePortFunction.java | 68 --
.../camel/zipkin/ZipkinClientRequestAdapter.java | 69 --
.../camel/zipkin/ZipkinClientResponseAdaptor.java | 59 --
.../org/apache/camel/zipkin/ZipkinConstants.java | 34 -
.../java/org/apache/camel/zipkin/ZipkinHelper.java | 56 --
.../camel/zipkin/ZipkinServerRequestAdapter.java | 60 --
.../camel/zipkin/ZipkinServerResponseAdapter.java | 70 --
.../java/org/apache/camel/zipkin/ZipkinState.java | 85 --
.../java/org/apache/camel/zipkin/ZipkinTracer.java | 881 ---------------------
.../org/apache/camel/zipkin/CamelRequestTest.java | 42 -
.../apache/camel/zipkin/LogSpanReporterTest.java | 31 -
.../camel/zipkin/ManagedZipkinSimpleRouteTest.java | 101 ---
.../camel/zipkin/SpringZipkinSimpleRouteTest.java | 46 --
.../apache/camel/zipkin/ZipkinABCRouteTest.java | 92 ---
.../camel/zipkin/ZipkinClientCustomTagsTest.java | 78 --
.../zipkin/ZipkinClientRecipientListRouteTest.java | 88 --
.../camel/zipkin/ZipkinMDCScopeDecoratorTest.java | 79 --
.../zipkin/ZipkinMultiServerNoClientTest.java | 72 --
.../camel/zipkin/ZipkinMulticastRouteTest.java | 93 ---
.../camel/zipkin/ZipkinOneRouteFallbackTest.java | 70 --
.../apache/camel/zipkin/ZipkinOneRouteTest.java | 68 --
.../camel/zipkin/ZipkinProducerSpanKindTest.java | 77 --
.../camel/zipkin/ZipkinRecipientListRouteTest.java | 90 ---
.../camel/zipkin/ZipkinRouteConcurrentTest.java | 81 --
.../camel/zipkin/ZipkinServerMulticastTest.java | 84 --
.../zipkin/ZipkinSimpleFallbackRouteTest.java | 74 --
.../zipkin/ZipkinSimpleLogStreamsRouteTest.java | 76 --
.../apache/camel/zipkin/ZipkinSimpleRouteTest.java | 75 --
.../zipkin/ZipkinSpanReporterInRegistryTest.java | 56 --
.../org/apache/camel/zipkin/ZipkinStateTest.java | 94 ---
.../apache/camel/zipkin/ZipkinTimerRouteTest.java | 78 --
.../org/apache/camel/zipkin/ZipkinTracerTest.java | 147 ----
.../apache/camel/zipkin/ZipkinTwoRouteTest.java | 79 --
.../camel/zipkin/http/ZipkinABCRouteHttp.java | 43 -
.../camel/zipkin/http/ZipkinAutoConfigureHttp.java | 88 --
.../zipkin/http/ZipkinMulticastRouteHttp.java | 43 -
.../zipkin/http/ZipkinOneRouteFallbackHttp.java | 43 -
.../camel/zipkin/http/ZipkinOneRouteHttp.java | 43 -
.../camel/zipkin/http/ZipkinSimpleRouteHttp.java | 43 -
.../camel/zipkin/http/ZipkinTimerRouteHttp.java | 43 -
.../camel/zipkin/http/ZipkinTwoRouteHttp.java | 43 -
.../scribe/ZipkinABCRouteScribeManualIT.java | 54 --
.../scribe/ZipkinAutoConfigureScribeManualIT.java | 90 ---
.../scribe/ZipkinMulticastRouteScribeManualIT.java | 54 --
.../ZipkinOneRouteFallbackScribeManualIT.java | 54 --
.../scribe/ZipkinOneRouteScribeManualIT.java | 54 --
.../scribe/ZipkinSimpleRouteScribeManualIT.java | 54 --
.../scribe/ZipkinTimerRouteScribeManualIT.java | 54 --
.../scribe/ZipkinTwoRouteScribeManualIT.java | 54 --
.../src/test/resources/log4j2.properties | 32 -
.../camel/zipkin/SpringZipkinSimpleRouteTest.xml | 52 --
components/pom.xml | 1 -
parent/pom.xml | 5 -
63 files changed, 1 insertion(+), 4768 deletions(-)
diff --git a/bom/camel-bom/pom.xml b/bom/camel-bom/pom.xml
index bf868f65a2e..624c74c458b 100644
--- a/bom/camel-bom/pom.xml
+++ b/bom/camel-bom/pom.xml
@@ -2206,11 +2206,6 @@
<artifactId>camel-zipfile</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-zipkin</artifactId>
- <version>${project.version}</version>
- </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-zookeeper</artifactId>
diff --git a/catalog/camel-allcomponents/pom.xml b/catalog/camel-allcomponents/pom.xml
index f2c9e25a00f..f290514db52 100644
--- a/catalog/camel-allcomponents/pom.xml
+++ b/catalog/camel-allcomponents/pom.xml
@@ -1918,11 +1918,6 @@
<artifactId>camel-zipfile</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-zipkin</artifactId>
- <version>${project.version}</version>
- </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-zookeeper</artifactId>
diff --git a/catalog/camel-catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java b/catalog/camel-catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java
index 400c14dd266..821ca92c00f 100644
--- a/catalog/camel-catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java
+++ b/catalog/camel-catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java
@@ -1565,10 +1565,6 @@ public class CamelCatalogTest {
Assertions.assertEquals("Marshal and unmarshal between POJOs and Comma separated values (CSV) format using Camel Bindy",
am.getDescription());
- am = catalog.modelFromMavenGAV("org.apache.camel", "camel-zipkin", catalog.getCatalogVersion());
- Assertions.assertInstanceOf(OtherModel.class, am);
- Assertions.assertEquals("Distributed message tracing using Zipkin", am.getDescription());
-
am = catalog.modelFromMavenGAV("org.apache.camel", "camel-unknown", catalog.getCatalogVersion());
Assertions.assertNull(am);
diff --git a/components/camel-tracing/src/main/docs/tracing.adoc b/components/camel-tracing/src/main/docs/tracing.adoc
index f6bb931bca0..a48903871b8 100644
--- a/components/camel-tracing/src/main/docs/tracing.adoc
+++ b/components/camel-tracing/src/main/docs/tracing.adoc
@@ -10,4 +10,4 @@
This module is common interfaces and API for distributed tracing.
-This module is not intended to be used by end users, but they should use `camel-opentelemetry`, `camel-opentracing` or `camel-zipkin` instead.
+This module is not intended to be used by end users, but they should use `camel-opentelemetry` or `camel-opentracing` instead.
diff --git a/components/camel-zipkin/pom.xml b/components/camel-zipkin/pom.xml
deleted file mode 100644
index 8e3ba32d330..00000000000
--- a/components/camel-zipkin/pom.xml
+++ /dev/null
@@ -1,121 +0,0 @@
-<?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>
- <artifactId>components</artifactId>
- <groupId>org.apache.camel</groupId>
- <version>4.0.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>camel-zipkin</artifactId>
- <packaging>jar</packaging>
- <name>Camel :: Zipkin (deprecated)</name>
- <description>Distributed message tracing using Zipkin</description>
-
- <properties>
- <camel.surefire.parallel>true</camel.surefire.parallel>
- <firstVersion>2.18.0</firstVersion>
- <label>monitoring,microservice</label>
- </properties>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-support</artifactId>
- </dependency>
-
- <!-- to send to zipkin server -->
- <dependency>
- <groupId>io.zipkin.reporter2</groupId>
- <artifactId>zipkin-sender-libthrift</artifactId>
- <version>${zipkin-reporter-version}</version>
- </dependency>
- <dependency>
- <groupId>io.zipkin.reporter2</groupId>
- <artifactId>zipkin-sender-urlconnection</artifactId>
- <version>${zipkin-reporter-version}</version>
- </dependency>
-
- <!-- brave/zipkin -->
- <dependency>
- <groupId>io.zipkin.brave</groupId>
- <artifactId>brave</artifactId>
- <version>${brave-zipkin-version}</version>
- </dependency>
- <dependency>
- <groupId>io.zipkin.brave</groupId>
- <artifactId>brave-context-slf4j</artifactId>
- <version>${brave-zipkin-version}</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </dependency>
-
- <!-- test dependencies -->
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-test-spring-junit5</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-management</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-slf4j-impl</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.assertj</groupId>
- <artifactId>assertj-core</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <!-- needed for testing auto configure -->
- <environmentVariables>
- <ZIPKIN_COLLECTOR_SERVICE_THRIFT_HOST>192.168.99.100</ZIPKIN_COLLECTOR_SERVICE_THRIFT_HOST>
- <ZIPKIN_COLLECTOR_SERVICE_THRIFT_PORT>9410</ZIPKIN_COLLECTOR_SERVICE_THRIFT_PORT>
- </environmentVariables>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-
-
-</project>
diff --git a/components/camel-zipkin/src/generated/resources/META-INF/services/org/apache/camel/other.properties b/components/camel-zipkin/src/generated/resources/META-INF/services/org/apache/camel/other.properties
deleted file mode 100644
index 50897925f69..00000000000
--- a/components/camel-zipkin/src/generated/resources/META-INF/services/org/apache/camel/other.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-# Generated by camel build tools - do NOT edit this file!
-name=zipkin
-groupId=org.apache.camel
-artifactId=camel-zipkin
-version=4.0.0-SNAPSHOT
-projectName=Camel :: Zipkin (deprecated)
-projectDescription=Distributed message tracing using Zipkin
diff --git a/components/camel-zipkin/src/generated/resources/zipkin.json b/components/camel-zipkin/src/generated/resources/zipkin.json
deleted file mode 100644
index cad3f851de6..00000000000
--- a/components/camel-zipkin/src/generated/resources/zipkin.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "other": {
- "kind": "other",
- "name": "zipkin",
- "title": "Zipkin",
- "description": "Distributed message tracing using Zipkin",
- "deprecated": true,
- "firstVersion": "2.18.0",
- "label": "monitoring,microservice",
- "supportLevel": "Stable",
- "groupId": "org.apache.camel",
- "artifactId": "camel-zipkin",
- "version": "4.0.0-SNAPSHOT"
- }
-}
diff --git a/components/camel-zipkin/src/main/docs/zipkin.adoc b/components/camel-zipkin/src/main/docs/zipkin.adoc
deleted file mode 100644
index 56fdc7db981..00000000000
--- a/components/camel-zipkin/src/main/docs/zipkin.adoc
+++ /dev/null
@@ -1,289 +0,0 @@
-= Zipkin Component (deprecated)
-:doctitle: Zipkin
-:shortname: zipkin
-:artifactid: camel-zipkin
-:description: Distributed message tracing using Zipkin
-:since: 2.18
-:supportlevel: Stable-deprecated
-:deprecated: *deprecated*
-//Manually maintained attributes
-:camel-spring-boot-name: zipkin
-
-*Since Camel {since}*
-
-The Camel Zipkin component is used for tracing and timing incoming and outgoing Camel messages using http://zipkin.io/[zipkin].
-
-Events (span) are captured for incoming and outgoing messages being sent to/from Camel.
-
-This means you need to configure which Camel endpoints map to zipkin service names.
-
-The mapping can be configured using:
-
-* route id - A Camel route id
-* endpoint url - A Camel endpoint url
-
-For both kinds you can match using wildcards and regular expressions, using the rules from Intercept.
-
-To match all Camel messages you can use * in the pattern and configure that to the same service name.
-
-If no mapping has been configured, Camel will fallback and use endpoint uri's as service names.
-However, it's recommended to configure service mappings so you can use human-readable names instead of Camel endpoint uris in the names.
-
-Camel will auto-configure a span reporter one hasn't been explicitly configured, and if the hostname and port to a zipkin collector has been configured as environment variables
-
-* ZIPKIN_COLLECTOR_HTTP_SERVICE_HOST - The http hostname
-* ZIPKIN_COLLECTOR_HTTP_SERVICE_PORT - The port number
-
-or
-
-* ZIPKIN_COLLECTOR_THRIFT_SERVICE_HOST - The Scribe (Thrift RPC) hostname
-* ZIPKIN_COLLECTOR_THRIFT_SERVICE_PORT - The port number
-
-This makes it easy to use camel-zipkin in container platforms where the platform can run your application in a linux container where service configurations are provided as environment variables.
-
-[[camel-zipkin-Options]]
-== Options
-
-[width="100%",cols="10%,10%,80%",options="header",]
-|===
-|Option
-|Default
-|Description
-
-|rate
-|1.0f
-|Configures a rate that decides how many events should be traced by zipkin.
-The rate is expressed as a percentage (1.0f = 100%, 0.5f is 50%, 0.1f is 10%).
-
-|spanReporter
-|
-|*Mandatory:* The reporter to use for sending zipkin span events to the zipkin server.
-
-|serviceName
-|
-| To use a global service name that matches all Camel events
-
-|clientServiceMappings
-|
-| Sets the *client* service mappings that matches Camel events to the given zipkin service name.
-The content is a `Map<String, String>` where the key is a pattern and the value is the service name.
-The pattern uses the rules from Intercept.
-
-|serverServiceMappings
-|
-| Sets the *server* service mappings that matches Camel events to the given zipkin service name.
-The content is a `Map<String, String>` where the key is a pattern and the value is the service name.
-The pattern uses the rules from Intercept.
-
-|excludePatterns
-|
-| Sets exclude pattern(s) that will disable tracing with zipkin for Camel messages that matches the pattern.
-The content is a `Set<String>` where the key is a pattern.
-The pattern uses the rules from Intercept.
-
-|includeMessageBody
-|false
-|Whether to include the Camel message body in the zipkin traces.
-This is not recommended for production usage, or when having big payloads.
-You can limit the size by configuring the xref:manual:faq:how-do-i-set-the-max-chars-when-debug-logging-messages-in-camel.adoc[max
-debug log size].
-
-|includeMessageBodyStreams
-|false
-|Whether to include message bodies that are stream based in the zipkin traces.
-This requires enabling streamcaching on the routes or globally on the `CamelContext`.
-This is not recommended for production usage, or when having big payloads.
-You can limit the size by configuring the xref:manual:faq:how-do-i-set-the-max-chars-when-debug-logging-messages-in-camel.adoc[max
-debug log size].
-
-|===
-
-
-[[camel-zipkin-Example]]
-== Example
-
-To enable camel-zipkin you need to configure first
-
-[source,java]
-----
-ZipkinTracer zipkin = new ZipkinTracer();
-// Configure a reporter, which controls how often spans are sent
-// (the dependency is io.zipkin.reporter2:zipkin-sender-okhttp3)
-sender = OkHttpSender.create("http://127.0.0.1:9411/api/v2/spans");
-zipkin.setSpanReporter(AsyncReporter.create(sender));
-// and then add zipkin to the CamelContext
-zipkin.init(camelContext);
-----
-
-The configuration above will trace all incoming and outgoing messages in Camel routes.
-
-To use ZipkinTracer in XML, all you need to do is to define scribe and zipkin tracer beans.
-Camel will automatically discover and use them.
-
-[source,xml]
-----
- <!-- configure how to reporter spans to a Zipkin collector
- (the dependency is io.zipkin.reporter2:zipkin-reporter-spring-beans) -->
- <bean id="http" class="zipkin2.reporter.beans.AsyncReporterFactoryBean">
- <property name="sender">
- <bean id="sender" class="zipkin2.reporter.beans.OkHttpSenderFactoryBean">
- <property name="endpoint" value="http://localhost:9411/api/v2/spans"/>
- </bean>
- </property>
- <!-- wait up to half a second for any in-flight spans on close -->
- <property name="closeTimeout" value="500"/>
- </bean>
-
- <!-- setup zipkin tracer -->
- <bean id="zipkinTracer" class="org.apache.camel.zipkin.ZipkinTracer">
- <property name="serviceName" value="dude"/>
- <property name="spanReporter" ref="http"/>
- </bean>
-----
-
-[[camel-zipkin-ServiceName]]
-== ServiceName
-
-However, if you want to map Camel endpoints to human friendly logical names, you can add mappings
-
-* ServiceName *
-
-You can configure a global service name that all events will fallback and use, such as:
-
-[source,java]
-----
-zipkin.setServiceName("invoices");
-----
-
-This will use the same service name for all incoming and outgoing zipkin traces.
-If your application uses different services, you should map them to more finely grained client / server service mappings
-
-[[camel-zipkin-ClientandServerServiceMappings]]
-== Client and Server Service Mappings
-
-* ClientServiceMappings
-* ServerServiceMappings
-
-If your application hosts a service that others can call, you can map the Camel route endpoint to a server service mapping.
-For example, suppose your Camel application has the following route:
-
-[source,java]
-----
-from("activemq:queue:inbox")
- .to("http:someserver/somepath");
-----
-
-And you want to make that as a server service, you can add the following mapping:
-
-[source,java]
-----
-zipkin.addServerServiceMapping("activemq:queue:inbox", "orders");
-----
-
-Then when a message is consumed from that inbox queue, it becomes a zipkin server event with the service name 'orders'.
-
-Now suppose that the call to http:someserver/somepath is also a service, which you want to map to a client service name, which can be done as:
-
-[source,java]
-----
-zipkin.addClientServiceMapping("http:someserver/somepath", "audit");
-----
-
-Then in the same Camel application you have mapped incoming and outgoing endpoints to different zipkin service names.
-
-You can use wildcards in the service mapping.
-To match all outgoing calls to the same HTTP server you can do:
-
-----
-zipkin.addClientServiceMapping("http:someserver*", "audit");
-----
-
-[[camel-zipkin-Mappingrules]]
-== Mapping rules
-
-The service name mapping for server occurs using the following rules
-
-. Is there an exclude pattern that matches the endpoint uri of the
-from endpoint?
-+
-If yes then skip.
-
-. Is there a match in the serviceServiceMapping that matches the
-endpoint uri of the from endpoint?
-+
-If yes, then use the found service name
-
-. Is there a match in the serviceServiceMapping that matches the route
-id of the current route?
-+
-If yes, then use the found service name
-
-. Is there a match in the serviceServiceMapping that matches the original route id where the exchange started?
-+
-If yes, then use the found service name
-
-. No service name was found, the exchange is not traced by zipkin
-
-The service name mapping for client occurs using the following rules:
-
-. Is there an exclude pattern that matches the endpoint uri of the from endpoint?
-+
-If yes then skip.
-
-. Is there a match in the clientServiceMapping that matches the endpoint uri of endpoint where the message is being sent to?
-+
-If yes, then use the found service name
-
-. Is there a match in the clientServiceMapping that matches the route id of the current route?
-+
-If yes, then use the found service name
-
-. Is there a match in the clientServiceMapping that matches the original route id where the exchange started?
-+
-If yes, then use the found service name
-
-. No service name was found, the exchange is not traced by zipkin
-
-[[camel-zipkin-Noclientorservermappings]]
-== No client or server mappings
-
-If there has been no configuration of client or server service mappings, CamelZipkin runs in a fallback mode, and uses endpoint uris as the service name.
-
-In the example above, this would mean the service names would be defined as if you add the following code yourself:
-
-[source,java]
-----
-zipkin.addServerServiceMapping("activemq:queue:inbox", "activemq:queue:inbox");
-zipkin.addClientServiceMapping("http:someserver/somepath", "http:someserver/somepath");
-----
-
-This is not a recommended approach, but gets you up and running quickly without doing any service name mappings.
-However, when you have multiple systems across your infrastructure, then you should consider using human-readable service names, that you map to instead of using the camel endpoint uris.
-
-[[camel-zipkin-CustomTags]]
-== Custom Tags
-
-If you need to send custom tags to Zipkin server, add an exchange property with name "camel.client.customtags" and value as a Map of your custom tags.
-Refrain from adding too many custom tags in production environment.
-
-Following is one example of how custom tags can be added:
-
-[source,java]
-----
-Map<String, String> customTags = new HashMap<>();
-customTags.put("key1", "value1");
-customTags.put("key2", "value2");
-exchange.setProperty("camel.client.customtags", customTags);
-----
-
-
-[[camel-zipkin-camel-zipin-starter]]
-== camel-zipkin-starter
-
-If you are using Spring Boot then you can add the `camel-zipkin-starter` dependency, and turn on zipkin by annotating the main class with `@CamelZipkin`.
-You can then configure camel-zipkin in the `application.properties` file where you can configure the hostname and port number for the Zipkin Server, and all the other options as listed in the options table above.
-
-You can find an example of this in the https://github.com/apache/camel-spring-boot-examples/tree/main/zipkin[camel-spring-boot-examples/zipkin]
-
-
-include::spring-boot:partial$starter.adoc[]
diff --git a/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/CamelRequest.java b/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/CamelRequest.java
deleted file mode 100644
index b498e1abc45..00000000000
--- a/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/CamelRequest.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * 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.zipkin;
-
-import brave.Request;
-import brave.Span;
-import brave.Span.Kind;
-import org.apache.camel.Message;
-
-public class CamelRequest extends Request {
-
- private final Message message;
- private final Span.Kind spanKind;
-
- public CamelRequest(Message message, Span.Kind spanKind) {
- this.message = message;
- this.spanKind = spanKind;
- }
-
- @Override
- public Kind spanKind() {
- return this.spanKind;
- }
-
- @Override
- public Object unwrap() {
- return this.message;
- }
-
- public void setHeader(String key, String value) {
- message.setHeader(key, value);
- }
-
- public String getHeader(String key) {
- return message.getHeader(key, String.class);
- }
-
-}
diff --git a/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ServiceHostFunction.java b/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ServiceHostFunction.java
deleted file mode 100644
index ac3dfba548c..00000000000
--- a/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ServiceHostFunction.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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.zipkin;
-
-import java.util.Locale;
-
-import org.apache.camel.util.StringHelper;
-
-/**
- * A function that lookup the property value from OS environment variables using the service idiom.
- * <p/>
- * A service is defined using two environment variables where name is name of the service:
- * <ul>
- * <li><tt>NAME_SERVICE_HOST</tt></li>
- * <li><tt>NAME_SERVICE_PORT</tt></li>
- * </ul>
- * in other words the service uses <tt>_SERVICE_HOST</tt> and <tt>_SERVICE_PORT</tt> as prefix.
- * <p/>
- * This implementation is to return the host part only.
- */
-public final class ServiceHostFunction {
-
- private static final String HOST_PREFIX = "_SERVICE_HOST";
-
- private ServiceHostFunction() {
- }
-
- public static String apply(String remainder) {
- String key = remainder;
- String defaultValue = null;
-
- if (remainder.contains(":")) {
- key = StringHelper.before(remainder, ":");
- defaultValue = StringHelper.after(remainder, ":");
- }
-
- // make sure to use upper case
- if (key != null) {
- // make sure to use underscore as dash is not supported as ENV variables
- key = key.toUpperCase(Locale.ENGLISH).replace('-', '_');
-
- // a service should have both the host and port defined
- String host = System.getenv(key + HOST_PREFIX);
-
- if (host != null) {
- return host;
- } else {
- return defaultValue;
- }
- }
-
- return defaultValue;
- }
-
-}
diff --git a/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ServicePortFunction.java b/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ServicePortFunction.java
deleted file mode 100644
index 07bbca760f1..00000000000
--- a/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ServicePortFunction.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * 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.zipkin;
-
-import java.util.Locale;
-
-import org.apache.camel.util.StringHelper;
-
-/**
- * A function that lookup the property value from OS environment variables using the service idiom.
- * <p/>
- * A service is defined using two environment variables where name is name of the service:
- * <ul>
- * <li><tt>NAME_SERVICE_HOST</tt></li>
- * <li><tt>NAME_SERVICE_PORT</tt></li>
- * </ul>
- * in other words the service uses <tt>_SERVICE_HOST</tt> and <tt>_SERVICE_PORT</tt> as prefix.
- * <p/>
- * This implementation is to return the port part only.
- */
-public final class ServicePortFunction {
-
- private static final String PORT_PREFIX = "_SERVICE_PORT";
-
- private ServicePortFunction() {
- }
-
- public static String apply(String remainder) {
- String key = remainder;
- String defaultValue = null;
-
- if (remainder.contains(":")) {
- key = StringHelper.before(remainder, ":");
- defaultValue = StringHelper.after(remainder, ":");
- }
-
- // make sure to use upper case
- if (key != null) {
- // make sure to use underscore as dash is not supported as ENV variables
- key = key.toUpperCase(Locale.ENGLISH).replace('-', '_');
-
- // a service should have both the host and port defined
- String port = System.getenv(key + PORT_PREFIX);
-
- if (port != null) {
- return port;
- } else {
- return defaultValue;
- }
- }
-
- return defaultValue;
- }
-}
diff --git a/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinClientRequestAdapter.java b/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinClientRequestAdapter.java
deleted file mode 100644
index 506d42921de..00000000000
--- a/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinClientRequestAdapter.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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.zipkin;
-
-import java.util.Locale;
-import java.util.Map;
-
-import brave.SpanCustomizer;
-import org.apache.camel.Endpoint;
-import org.apache.camel.Exchange;
-import org.apache.camel.StreamCache;
-import org.apache.camel.support.MessageHelper;
-import org.apache.camel.util.URISupport;
-
-import static org.apache.camel.zipkin.ZipkinHelper.prepareBodyForLogging;
-
-final class ZipkinClientRequestAdapter {
-
- private final ZipkinTracer eventNotifier;
- private final String spanName;
- private final String url;
-
- ZipkinClientRequestAdapter(ZipkinTracer eventNotifier, Endpoint endpoint) {
- this.eventNotifier = eventNotifier;
- this.spanName = URISupport.sanitizeUri(endpoint.getEndpointKey()).toLowerCase(Locale.ROOT);
- this.url = URISupport.sanitizeUri(endpoint.getEndpointUri());
- }
-
- void onRequest(Exchange exchange, SpanCustomizer span) {
- span.name(spanName);
-
- span.tag("camel.client.endpoint.url", url);
- span.tag("camel.client.exchange.id", exchange.getExchangeId());
- span.tag("camel.client.exchange.pattern", exchange.getPattern().name());
-
- if (eventNotifier.isIncludeMessageBody() || eventNotifier.isIncludeMessageBodyStreams()) {
- boolean streams = eventNotifier.isIncludeMessageBodyStreams();
- StreamCache cache = prepareBodyForLogging(exchange, streams);
- String body = MessageHelper.extractBodyForLogging(exchange.getMessage(), "", streams, streams);
- span.tag("camel.client.exchange.message.request.body", body);
- if (cache != null) {
- cache.reset();
- }
- }
-
- eventNotifier.getClientCustomTags().forEach((key, value) -> span.tag("custom." + key, value));
-
- Map<String, String> customTags = exchange.getProperty("camel.client.customtags", Map.class);
- if (customTags != null && !customTags.isEmpty()) {
- for (Map.Entry<String, String> tag : customTags.entrySet()) {
- span.tag("custom." + tag.getKey(), tag.getValue());
- }
- }
- }
-}
diff --git a/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinClientResponseAdaptor.java b/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinClientResponseAdaptor.java
deleted file mode 100644
index 824bd730786..00000000000
--- a/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinClientResponseAdaptor.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * 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.zipkin;
-
-import brave.SpanCustomizer;
-import org.apache.camel.Endpoint;
-import org.apache.camel.Exchange;
-import org.apache.camel.StreamCache;
-import org.apache.camel.support.MessageHelper;
-import org.apache.camel.util.URISupport;
-
-import static org.apache.camel.zipkin.ZipkinHelper.prepareBodyForLogging;
-
-class ZipkinClientResponseAdaptor {
-
- private final ZipkinTracer eventNotifier;
- private final String url;
-
- ZipkinClientResponseAdaptor(ZipkinTracer eventNotifier, Endpoint endpoint) {
- this.eventNotifier = eventNotifier;
- this.url = URISupport.sanitizeUri(endpoint.getEndpointUri());
- }
-
- void onResponse(Exchange exchange, SpanCustomizer span) {
- span.tag("camel.client.endpoint.url", url);
- span.tag("camel.client.exchange.id", exchange.getExchangeId());
- span.tag("camel.client.exchange.pattern", exchange.getPattern().name());
-
- if (eventNotifier.isIncludeMessageBody() || eventNotifier.isIncludeMessageBodyStreams()) {
- boolean streams = eventNotifier.isIncludeMessageBodyStreams();
- StreamCache cache = prepareBodyForLogging(exchange, streams);
- String body = MessageHelper.extractBodyForLogging(exchange.getMessage(), "", streams, streams);
- span.tag("camel.client.exchange.message.response.body", body);
- if (cache != null) {
- cache.reset();
- }
- }
-
- // lets capture http response code for http based components
- String responseCode = exchange.getMessage().getHeader(Exchange.HTTP_RESPONSE_CODE, String.class);
- if (responseCode != null) {
- span.tag("camel.client.exchange.message.response.code", responseCode);
- }
- }
-}
diff --git a/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinConstants.java b/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinConstants.java
deleted file mode 100644
index ba1120f0c0c..00000000000
--- a/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinConstants.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * 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.zipkin;
-
-/**
- * Contains the header keys that are used to represent trace id, span id, parent span id, sampled.
- * <p/>
- * The names correspond with the zipkin header values.
- */
-public final class ZipkinConstants {
-
- public static final String TRACE_ID = "X-B3-TraceId";
- public static final String SPAN_ID = "X-B3-SpanId";
- public static final String PARENT_SPAN_ID = "X-B3-ParentSpanId";
- public static final String SAMPLED = "X-B3-Sampled";
-
- private ZipkinConstants() {
- }
-
-}
diff --git a/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinHelper.java b/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinHelper.java
deleted file mode 100644
index db9ee7ee8dc..00000000000
--- a/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinHelper.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * 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.zipkin;
-
-import org.apache.camel.Exchange;
-import org.apache.camel.Message;
-import org.apache.camel.StreamCache;
-
-/**
- * Helper class.
- */
-public final class ZipkinHelper {
-
- private ZipkinHelper() {
- }
-
- public static StreamCache prepareBodyForLogging(Exchange exchange, boolean streams) {
- if (!streams) {
- // no need to prepare if streams is not enabled
- return null;
- }
-
- Message message = exchange.getMessage();
- // check if body is already cached
- Object body = message.getBody();
- if (body == null) {
- return null;
- } else if (body instanceof StreamCache) {
- StreamCache sc = (StreamCache) body;
- // reset so the cache is ready to be used before processing
- sc.reset();
- return sc;
- }
- // cache the body and if we could do that replace it as the new body
- StreamCache sc = exchange.getContext().getStreamCachingStrategy().cache(exchange);
- if (sc != null) {
- message.setBody(sc);
- }
- return sc;
- }
-
-}
diff --git a/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinServerRequestAdapter.java b/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinServerRequestAdapter.java
deleted file mode 100644
index 392fe8802b5..00000000000
--- a/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinServerRequestAdapter.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * 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.zipkin;
-
-import java.util.Locale;
-
-import brave.SpanCustomizer;
-import org.apache.camel.Endpoint;
-import org.apache.camel.Exchange;
-import org.apache.camel.StreamCache;
-import org.apache.camel.support.MessageHelper;
-import org.apache.camel.util.URISupport;
-
-import static org.apache.camel.zipkin.ZipkinHelper.prepareBodyForLogging;
-
-class ZipkinServerRequestAdapter {
-
- private final ZipkinTracer eventNotifier;
- private final Endpoint endpoint;
- private final String spanName;
- private final String url;
-
- ZipkinServerRequestAdapter(ZipkinTracer eventNotifier, Exchange exchange) {
- this.eventNotifier = eventNotifier;
- this.endpoint = exchange.getFromEndpoint();
- this.spanName = URISupport.sanitizeUri(endpoint.getEndpointKey()).toLowerCase(Locale.ROOT);
- this.url = URISupport.sanitizeUri(endpoint.getEndpointUri());
- }
-
- void onRequest(Exchange exchange, SpanCustomizer span) {
- span.name(spanName);
- span.tag("camel.server.endpoint.url", url);
- span.tag("camel.server.exchange.id", exchange.getExchangeId());
- span.tag("camel.server.exchange.pattern", exchange.getPattern().name());
-
- if (eventNotifier.isIncludeMessageBody() || eventNotifier.isIncludeMessageBodyStreams()) {
- boolean streams = eventNotifier.isIncludeMessageBodyStreams();
- StreamCache cache = prepareBodyForLogging(exchange, streams);
- String body = MessageHelper.extractBodyForLogging(exchange.getMessage(), "", streams, streams);
- span.tag("camel.server.exchange.message.request.body", body);
- if (cache != null) {
- cache.reset();
- }
- }
- }
-}
diff --git a/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinServerResponseAdapter.java b/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinServerResponseAdapter.java
deleted file mode 100644
index ac4239dda55..00000000000
--- a/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinServerResponseAdapter.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * 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.zipkin;
-
-import brave.SpanCustomizer;
-import org.apache.camel.Endpoint;
-import org.apache.camel.Exchange;
-import org.apache.camel.StreamCache;
-import org.apache.camel.support.MessageHelper;
-import org.apache.camel.util.ObjectHelper;
-import org.apache.camel.util.URISupport;
-
-import static org.apache.camel.zipkin.ZipkinHelper.prepareBodyForLogging;
-
-class ZipkinServerResponseAdapter {
-
- private final ZipkinTracer eventNotifier;
- private final Endpoint endpoint;
- private final String url;
-
- ZipkinServerResponseAdapter(ZipkinTracer eventNotifier, Exchange exchange) {
- this.eventNotifier = eventNotifier;
- this.endpoint = exchange.getFromEndpoint();
- this.url = URISupport.sanitizeUri(endpoint.getEndpointUri());
- }
-
- void onResponse(Exchange exchange, SpanCustomizer span) {
- String id = exchange.getExchangeId();
- String mep = exchange.getPattern().name();
-
- span.tag("camel.server.endpoint.url", url);
- span.tag("camel.server.exchange.id", id);
- span.tag("camel.server.exchange.pattern", mep);
-
- if (exchange.getException() != null) {
- String message = ObjectHelper.isEmpty(exchange.getException().getMessage())
- ? exchange.getException().getClass().getName() : exchange.getException().getMessage();
- span.tag("camel.server.exchange.failure", message);
- } else if (eventNotifier.isIncludeMessageBody() || eventNotifier.isIncludeMessageBodyStreams()) {
- boolean streams = eventNotifier.isIncludeMessageBodyStreams();
- StreamCache cache = prepareBodyForLogging(exchange, streams);
- String body = MessageHelper.extractBodyForLogging(exchange.getMessage(), "", streams, streams);
- span.tag("camel.server.exchange.message.response.body", body);
- if (cache != null) {
- cache.reset();
- }
- }
-
- // lets capture http response code for http based components
- String responseCode = exchange.getMessage().getHeader(Exchange.HTTP_RESPONSE_CODE, String.class);
- if (responseCode != null) {
- span.tag("camel.server.exchange.message.response.code", responseCode);
- }
- }
-
-}
diff --git a/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinState.java b/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinState.java
deleted file mode 100644
index 848ef024cf1..00000000000
--- a/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinState.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * 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.zipkin;
-
-import java.util.Deque;
-import java.util.concurrent.ConcurrentLinkedDeque;
-
-import brave.Span;
-import org.apache.camel.Exchange;
-import org.apache.camel.SafeCopyProperty;
-
-/**
- * The state of the zipkin trace which we store on the {@link Exchange}
- * <p/>
- * This is needed to keep track of of correlating when an existing span is calling downstream service(s) and therefore
- * must be able to correlate those service calls with the parent span.
- */
-public final class ZipkinState implements SafeCopyProperty {
-
- public static final String KEY = "CamelZipkinState";
-
- private final Deque<Span> clientSpans = new ConcurrentLinkedDeque<>();
- private final Deque<Span> serverSpans = new ConcurrentLinkedDeque<>();
-
- public ZipkinState() {
-
- }
-
- private ZipkinState(ZipkinState state) {
- this.clientSpans.addAll(state.clientSpans);
- this.serverSpans.addAll(state.serverSpans);
- }
-
- public void pushClientSpan(Span span) {
- clientSpans.push(span);
- }
-
- public Span popClientSpan() {
- if (!clientSpans.isEmpty()) {
- return clientSpans.pop();
- } else {
- return null;
- }
- }
-
- public void pushServerSpan(Span span) {
- serverSpans.push(span);
- }
-
- public Span popServerSpan() {
- if (!serverSpans.isEmpty()) {
- return serverSpans.pop();
- } else {
- return null;
- }
- }
-
- public Span peekServerSpan() {
- if (!serverSpans.isEmpty()) {
- return serverSpans.peek();
- } else {
- return null;
- }
- }
-
- @Override
- public ZipkinState safeCopy() {
- return new ZipkinState(this);
- }
-
-}
diff --git a/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinTracer.java b/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinTracer.java
deleted file mode 100644
index 6934986f285..00000000000
--- a/components/camel-zipkin/src/main/java/org/apache/camel/zipkin/ZipkinTracer.java
+++ /dev/null
@@ -1,881 +0,0 @@
-/*
- * 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.zipkin;
-
-import java.io.Closeable;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import brave.Span;
-import brave.Span.Kind;
-import brave.SpanCustomizer;
-import brave.Tracing;
-import brave.context.slf4j.MDCScopeDecorator;
-import brave.propagation.B3Propagation;
-import brave.propagation.Propagation.Getter;
-import brave.propagation.Propagation.Setter;
-import brave.propagation.ThreadLocalCurrentTraceContext;
-import brave.propagation.TraceContext;
-import brave.propagation.TraceContext.Extractor;
-import brave.propagation.TraceContext.Injector;
-import brave.propagation.TraceContextOrSamplingFlags;
-import brave.sampler.Sampler;
-import org.apache.camel.CamelContext;
-import org.apache.camel.CamelContextAware;
-import org.apache.camel.Endpoint;
-import org.apache.camel.Exchange;
-import org.apache.camel.Expression;
-import org.apache.camel.ExtendedExchange;
-import org.apache.camel.NamedNode;
-import org.apache.camel.Route;
-import org.apache.camel.RuntimeCamelException;
-import org.apache.camel.StaticService;
-import org.apache.camel.api.management.ManagedAttribute;
-import org.apache.camel.api.management.ManagedResource;
-import org.apache.camel.spi.CamelEvent;
-import org.apache.camel.spi.CamelEvent.ExchangeSendingEvent;
-import org.apache.camel.spi.CamelEvent.ExchangeSentEvent;
-import org.apache.camel.spi.RoutePolicy;
-import org.apache.camel.spi.RoutePolicyFactory;
-import org.apache.camel.support.EndpointHelper;
-import org.apache.camel.support.EventNotifierSupport;
-import org.apache.camel.support.ExchangeHelper;
-import org.apache.camel.support.PatternHelper;
-import org.apache.camel.support.RoutePolicySupport;
-import org.apache.camel.support.service.ServiceHelper;
-import org.apache.camel.support.service.ServiceSupport;
-import org.apache.camel.util.IOHelper;
-import org.apache.camel.util.ObjectHelper;
-import org.apache.camel.util.URISupport;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.slf4j.MDC;
-import zipkin2.reporter.AsyncReporter;
-import zipkin2.reporter.Reporter;
-import zipkin2.reporter.libthrift.LibthriftSender;
-import zipkin2.reporter.urlconnection.URLConnectionSender;
-
-/**
- * To use Zipkin with Camel then setup this {@link ZipkinTracer} in your Camel application.
- * <p/>
- * Events (span) are captured for incoming and outgoing messages being sent to/from Camel. This means you need to
- * configure which which Camel endpoints that maps to zipkin service names. The mapping can be configured using
- * <ul>
- * <li>route id - A Camel route id</li>
- * <li>endpoint url - A Camel endpoint url</li>
- * </ul>
- * For both kinds you can use wildcards and regular expressions to match, which is using the rules from
- * {@link PatternHelper#matchPattern(String, String)} and
- * {@link EndpointHelper#matchEndpoint(CamelContext, String, String)}
- * <p/>
- * To match all Camel messages you can use <tt>*</tt> in the pattern and configure that to the same service name. <br/>
- * If no mapping has been configured then Camel will fallback and use endpoint uri's as service names. However its
- * recommended to configure service mappings so you can use human logic names instead of Camel endpoint uris in the
- * names.
- * <p/>
- * Camel will auto-configure a {@link Reporter span reporter} one hasn't been explicitly configured, and if the hostname
- * and port to a zipkin collector has been configured as environment variables
- * <ul>
- * <li>ZIPKIN_COLLECTOR_HTTP_SERVICE_HOST - The http hostname</li>
- * <li>ZIPKIN_COLLECTOR_HTTP_SERVICE_PORT - The port number</li>
- * </ul>
- * or
- * <ul>
- * <li>ZIPKIN_COLLECTOR_THRIFT_SERVICE_HOST - The Scribe (Thrift RPC) hostname</li>
- * <li>ZIPKIN_COLLECTOR_THRIFT_SERVICE_PORT - The port number</li>
- * </ul>
- * <p/>
- * This class is implemented as both an {@link org.apache.camel.spi.EventNotifier} and {@link RoutePolicy} that allows
- * to trap when Camel starts/ends an {@link Exchange} being routed using the {@link RoutePolicy} and during the routing
- * if the {@link Exchange} sends messages, then we track them using the {@link org.apache.camel.spi.EventNotifier}.
- */
-// NOTE: this implementation currently only does explicit propagation, meaning
-// that non-camel
-// components will not see the current trace context, and therefore will be
-// unassociated. This can
-// be fixed by using CurrentTraceContext to scope a span where user code is
-// invoked.
-// If this is desirable, an instance variable of
-// CurrentTraceContext.Default.create() could do the
-// trick.
-@ManagedResource(description = "ZipkinTracer")
-public class ZipkinTracer extends ServiceSupport implements RoutePolicyFactory, StaticService, CamelContextAware {
-
- private static final Logger LOG = LoggerFactory.getLogger(ZipkinTracer.class);
- private static final String ZIPKIN_COLLECTOR_HTTP_SERVICE = "zipkin-collector-http";
- private static final String ZIPKIN_COLLECTOR_THRIFT_SERVICE = "zipkin-collector-thrift";
- private static final Getter<CamelRequest, String> GETTER = (cr, key) -> cr.getHeader(key);
- private static final Setter<CamelRequest, String> SETTER = (cr, key, value) -> cr.setHeader(key, value);
- static final Extractor<CamelRequest> EXTRACTOR = B3Propagation.B3_STRING.extractor(GETTER);
- private static final Injector<CamelRequest> INJECTOR = B3Propagation.B3_STRING.injector(SETTER);
-
- private final ZipkinEventNotifier eventNotifier = new ZipkinEventNotifier();
- private final Map<String, Tracing> braves = new HashMap<>();
- private transient boolean useFallbackServiceNames;
-
- private CamelContext camelContext;
- private String endpoint;
- private String hostName;
- private int port;
- private float rate = 1.0f;
- private Reporter<zipkin2.Span> spanReporter;
- private Map<String, String> clientServiceMappings = new HashMap<>();
- private Map<String, String> serverServiceMappings = new HashMap<>();
- private Set<String> excludePatterns = new HashSet<>();
- private boolean includeMessageBody;
- private boolean includeMessageBodyStreams;
- private Map<String, String> clientCustomTags = Collections.emptyMap();
-
- private final Map<String, Span.Kind> producerComponentToSpanKind = new HashMap<>();
- private final Map<String, Span.Kind> consumerComponentToSpanKind = new HashMap<>();
-
- public ZipkinTracer() {
- producerComponentToSpanKind.put("jms", Span.Kind.PRODUCER);
- producerComponentToSpanKind.put("sjms", Span.Kind.PRODUCER);
- producerComponentToSpanKind.put("activemq", Span.Kind.PRODUCER);
- producerComponentToSpanKind.put("kafka", Span.Kind.PRODUCER);
- producerComponentToSpanKind.put("amqp", Span.Kind.PRODUCER);
-
- consumerComponentToSpanKind.put("jms", Span.Kind.CONSUMER);
- consumerComponentToSpanKind.put("sjms", Span.Kind.CONSUMER);
- consumerComponentToSpanKind.put("activemq", Span.Kind.CONSUMER);
- consumerComponentToSpanKind.put("kafka", Span.Kind.CONSUMER);
- consumerComponentToSpanKind.put("amqp", Span.Kind.CONSUMER);
- }
-
- @Override
- public RoutePolicy createRoutePolicy(CamelContext camelContext, String routeId, NamedNode route) {
- // ensure this zipkin tracer gets initialized when Camel starts
- init(camelContext);
- return new ZipkinRoutePolicy();
- }
-
- /**
- * Registers this {@link ZipkinTracer} on the {@link CamelContext} if not already registered.
- */
- public void init(CamelContext camelContext) {
- if (!camelContext.hasService(this)) {
- try {
- // start this service eager so we init before Camel is starting
- // up
- camelContext.addService(this, true, true);
- } catch (Exception e) {
- throw RuntimeCamelException.wrapRuntimeCamelException(e);
- }
- }
- }
-
- @Override
- public CamelContext getCamelContext() {
- return camelContext;
- }
-
- @Override
- public void setCamelContext(CamelContext camelContext) {
- this.camelContext = camelContext;
- }
-
- @ManagedAttribute(description = "The POST URL for zipkin's v2 api.")
- public String getEndpoint() {
- return endpoint;
- }
-
- /**
- * Sets the POST URL for zipkin's <a href="http://zipkin.io/zipkin-api/#/">v2 api</a>, usually
- * "http://zipkinhost:9411/api/v2/spans"
- */
- public void setEndpoint(String endpoint) {
- this.endpoint = endpoint;
- }
-
- @ManagedAttribute(description = "The hostname for the remote zipkin scribe collector.")
- public String getHostName() {
- return hostName;
- }
-
- /**
- * Sets the hostname for the remote zipkin scribe collector.
- */
- public void setHostName(String hostName) {
- this.hostName = hostName;
- }
-
- @ManagedAttribute(description = "The port number for the remote zipkin scribe collector.")
- public int getPort() {
- return port;
- }
-
- /**
- * Sets the port number for the remote zipkin scribe collector.
- */
- public void setPort(int port) {
- this.port = port;
- }
-
- @ManagedAttribute(description = "Rates how many events should be traced by zipkin. The rate is expressed as a percentage (1.0f = 100%, 0.5f is 50%, 0.1f is 10%).")
- public float getRate() {
- return rate;
- }
-
- /**
- * Configures a rate that decides how many events should be traced by zipkin. The rate is expressed as a percentage
- * (1.0f = 100%, 0.5f is 50%, 0.1f is 10%).
- *
- * @param rate minimum sample rate is 0.0001, or 0.01% of traces
- */
- public void setRate(float rate) {
- this.rate = rate;
- }
-
- /**
- * Sets the reporter used to send timing data (spans) to the zipkin server.
- */
- public void setSpanReporter(Reporter<zipkin2.Span> spanReporter) {
- this.spanReporter = spanReporter;
- }
-
- /**
- * Returns the reporter used to send timing data (spans) to the zipkin server.
- */
- public Reporter<zipkin2.Span> getSpanReporter() {
- return spanReporter;
- }
-
- public String getServiceName() {
- return clientServiceMappings.get("*");
- }
-
- /**
- * To use a global service name that matches all Camel events
- */
- public void setServiceName(String serviceName) {
- clientServiceMappings.put("*", serviceName);
- serverServiceMappings.put("*", serviceName);
- }
-
- public Map<String, String> getClientServiceMappings() {
- return clientServiceMappings;
- }
-
- public void setClientServiceMappings(Map<String, String> clientServiceMappings) {
- this.clientServiceMappings = clientServiceMappings;
- }
-
- /**
- * Adds a client service mapping that matches Camel events to the given zipkin service name. See more details at the
- * class javadoc.
- *
- * @param pattern the pattern such as route id, endpoint url
- * @param serviceName the zipkin service name
- */
- public void addClientServiceMapping(String pattern, String serviceName) {
- clientServiceMappings.put(pattern, serviceName);
- }
-
- public Map<String, String> getServerServiceMappings() {
- return serverServiceMappings;
- }
-
- public void setServerServiceMappings(Map<String, String> serverServiceMappings) {
- this.serverServiceMappings = serverServiceMappings;
- }
-
- /**
- * Adds a server service mapping that matches Camel events to the given zipkin service name. See more details at the
- * class javadoc.
- *
- * @param pattern the pattern such as route id, endpoint url
- * @param serviceName the zipkin service name
- */
- public void addServerServiceMapping(String pattern, String serviceName) {
- serverServiceMappings.put(pattern, serviceName);
- }
-
- public Set<String> getExcludePatterns() {
- return excludePatterns;
- }
-
- public void setExcludePatterns(Set<String> excludePatterns) {
- this.excludePatterns = excludePatterns;
- }
-
- /**
- * Adds an exclude pattern that will disable tracing with zipkin 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);
- }
-
- @ManagedAttribute(description = "Whether to include the Camel message body in the zipkin traces")
- public boolean isIncludeMessageBody() {
- return includeMessageBody;
- }
-
- /**
- * Whether to include the Camel message body in the zipkin traces.
- * <p/>
- * This is not recommended for production usage, or when having big payloads. You can limit the size by configuring
- * the <a href= "http://camel.apache.org/how-do-i-set-the-max-chars-when-debug-logging-messages-in-camel.html">max
- * debug log size</a>.
- * <p/>
- * By default message bodies that are stream based are <b>not</b> included. You can use the option
- * {@link #setIncludeMessageBodyStreams(boolean)} to turn that on.
- */
- @ManagedAttribute(description = "Whether to include the Camel message body in the zipkin traces")
- public void setIncludeMessageBody(boolean includeMessageBody) {
- this.includeMessageBody = includeMessageBody;
- }
-
- @ManagedAttribute(description = "Whether to include stream based Camel message bodies in the zipkin traces")
- public boolean isIncludeMessageBodyStreams() {
- return includeMessageBodyStreams;
- }
-
- /**
- * Whether to include message bodies that are stream based in the zipkin traces.
- * <p/>
- * This requires enabling <a href="http://camel.apache.org/stream-caching.html">stream caching</a> on the routes or
- * globally on the CamelContext.
- * <p/>
- * This is not recommended for production usage, or when having big payloads. You can limit the size by configuring
- * the <a href= "http://camel.apache.org/how-do-i-set-the-max-chars-when-debug-logging-messages-in-camel.html">max
- * debug log size</a>.
- */
- @ManagedAttribute(description = "Whether to include stream based Camel message bodies in the zipkin traces")
- public void setIncludeMessageBodyStreams(boolean includeMessageBodyStreams) {
- this.includeMessageBodyStreams = includeMessageBodyStreams;
- }
-
- /**
- * Custom tags that should be included on all client requests, in addition to the tags specified on the Exchange via
- * <code>camel.client.customtags</code>.
- *
- * @param clientCustomTags custom tags to be added for all client requests
- * @see ZipkinClientRequestAdapter#onRequest(Exchange, SpanCustomizer)
- */
- public void setClientCustomTags(Map<String, String> clientCustomTags) {
- this.clientCustomTags = clientCustomTags == null ? Collections.emptyMap() : new HashMap<>(clientCustomTags);
- }
-
- /**
- * Custom tags that are added for all client requests.
- *
- * @return custom tags added for all client requests
- * @see ZipkinClientRequestAdapter#onRequest(Exchange, SpanCustomizer)
- */
- public Map<String, String> getClientCustomTags() {
- return clientCustomTags;
- }
-
- @Override
- protected void doInit() throws Exception {
- ObjectHelper.notNull(camelContext, "CamelContext", this);
-
- camelContext.getManagementStrategy().addEventNotifier(eventNotifier);
- if (!camelContext.getRoutePolicyFactories().contains(this)) {
- camelContext.addRoutePolicyFactory(this);
- }
-
- if (spanReporter == null) {
- if (endpoint != null) {
- LOG.info("Configuring Zipkin URLConnectionSender using endpoint: {}", endpoint);
- spanReporter = AsyncReporter.create(URLConnectionSender.create(endpoint));
- } else if (hostName != null && port > 0) {
- LOG.info("Configuring Zipkin ScribeSpanCollector using host: {} and port: {}", hostName, port);
- LibthriftSender sender = LibthriftSender.newBuilder().host(hostName).port(port).build();
- spanReporter = AsyncReporter.create(sender);
- } else {
- // is there a zipkin service setup as ENV variable to auto
- // register a span reporter
- String host = ServiceHostFunction.apply(ZIPKIN_COLLECTOR_HTTP_SERVICE);
- String port = ServicePortFunction.apply(ZIPKIN_COLLECTOR_HTTP_SERVICE);
- if (ObjectHelper.isNotEmpty(host) && ObjectHelper.isNotEmpty(port)) {
- LOG.info("Auto-configuring Zipkin URLConnectionSender using host: {} and port: {}", host, port);
- int num = camelContext.getTypeConverter().mandatoryConvertTo(Integer.class, port);
- String implicitEndpoint = "http://" + host + ":" + num + "/api/v2/spans";
- spanReporter = AsyncReporter.create(URLConnectionSender.create(implicitEndpoint));
- } else {
- host = ServiceHostFunction.apply(ZIPKIN_COLLECTOR_THRIFT_SERVICE);
- port = ServicePortFunction.apply(ZIPKIN_COLLECTOR_THRIFT_SERVICE);
- if (ObjectHelper.isNotEmpty(host) && ObjectHelper.isNotEmpty(port)) {
- LOG.info("Auto-configuring Zipkin ScribeSpanCollector using host: {} and port: {}", host, port);
- int num = camelContext.getTypeConverter().mandatoryConvertTo(Integer.class, port);
- LibthriftSender sender = LibthriftSender.newBuilder().host(host).port(num).build();
- spanReporter = AsyncReporter.create(sender);
- }
- }
- }
- }
-
- if (spanReporter == null) {
- // Try to lookup the span reporter from the registry if only one
- // instance is present
- Set<Reporter> reporters = camelContext.getRegistry().findByType(Reporter.class);
- if (reporters.size() == 1) {
- spanReporter = reporters.iterator().next();
- }
- }
-
- ObjectHelper.notNull(spanReporter, "Reporter<zipkin2.Span>", this);
-
- if (clientServiceMappings.isEmpty() && serverServiceMappings.isEmpty()) {
- LOG.warn(
- "No service name(s) has been mapped in clientServiceMappings or serverServiceMappings. Camel will fallback and use endpoint uris as service names.");
- useFallbackServiceNames = true;
- }
-
- // create braves mapped per service name
- for (Map.Entry<String, String> entry : clientServiceMappings.entrySet()) {
- String pattern = entry.getKey();
- String serviceName = entry.getValue();
- createTracingForService(pattern, serviceName);
- }
- for (Map.Entry<String, String> entry : serverServiceMappings.entrySet()) {
- String pattern = entry.getKey();
- String serviceName = entry.getValue();
- createTracingForService(pattern, serviceName);
- }
-
- ServiceHelper.startService(spanReporter, eventNotifier);
- }
-
- @Override
- protected void doShutdown() throws Exception {
- // stop event notifier
- camelContext.getManagementStrategy().removeEventNotifier(eventNotifier);
- ServiceHelper.stopService(eventNotifier);
-
- // stop and close collector
- ServiceHelper.stopAndShutdownService(spanReporter);
- if (spanReporter instanceof Closeable) {
- IOHelper.close((Closeable) spanReporter);
- }
- // clear braves
- braves.clear();
- // remove route policy
- camelContext.getRoutePolicyFactories().remove(this);
- }
-
- private String getServiceName(Exchange exchange, Endpoint endpoint, boolean server, boolean client) {
- if (client) {
- return getServiceName(exchange, endpoint, clientServiceMappings);
- } else if (server) {
- return getServiceName(exchange, endpoint, serverServiceMappings);
- } else {
- return null;
- }
- }
-
- private String getServiceName(Exchange exchange, Endpoint endpoint, Map<String, String> serviceMappings) {
- String answer = null;
-
- // endpoint takes precedence over route
- if (endpoint != null) {
- String url = endpoint.getEndpointUri();
- if (url != null) {
- // exclude patterns take precedence
- for (String pattern : excludePatterns) {
- if (EndpointHelper.matchEndpoint(exchange.getContext(), url, pattern)) {
- return null;
- }
- }
- for (Map.Entry<String, String> entry : serviceMappings.entrySet()) {
- String pattern = entry.getKey();
- if (EndpointHelper.matchEndpoint(exchange.getContext(), url, pattern)) {
- answer = entry.getValue();
- break;
- }
- }
- }
- }
-
- // route
- if (answer == null) {
- String id = routeIdExpression().evaluate(exchange, String.class);
- if (id != null) {
- // exclude patterns take precedence
- for (String pattern : excludePatterns) {
- if (PatternHelper.matchPattern(id, pattern)) {
- return null;
- }
- }
- for (Map.Entry<String, String> entry : serviceMappings.entrySet()) {
- String pattern = entry.getKey();
- if (PatternHelper.matchPattern(id, pattern)) {
- answer = entry.getValue();
- break;
- }
- }
- }
- }
-
- if (answer == null) {
- String id = exchange.getFromRouteId();
- if (id != null) {
- // exclude patterns take precedence
- for (String pattern : excludePatterns) {
- if (PatternHelper.matchPattern(id, pattern)) {
- return null;
- }
- }
- for (Map.Entry<String, String> entry : serviceMappings.entrySet()) {
- String pattern = entry.getKey();
- if (PatternHelper.matchPattern(id, pattern)) {
- answer = entry.getValue();
- break;
- }
- }
- }
- }
-
- if (answer == null && useFallbackServiceNames) {
- String key = null;
- if (endpoint != null) {
- key = endpoint.getEndpointKey();
- } else if (exchange.getFromEndpoint() != null) {
- key = exchange.getFromEndpoint().getEndpointKey();
- }
- // exclude patterns take precedence
- for (String pattern : excludePatterns) {
- if (PatternHelper.matchPattern(key, pattern)) {
- return null;
- }
- }
- String sanitizedKey = URISupport.sanitizeUri(key);
- if (LOG.isTraceEnabled() && sanitizedKey != null) {
- LOG.trace("Using serviceName: {} as fallback", sanitizedKey);
- }
- return sanitizedKey;
- } else {
- if (LOG.isTraceEnabled() && answer != null) {
- LOG.trace("Using serviceName: {}", answer);
- }
- return answer;
- }
- }
-
- private void createTracingForService(String pattern, String serviceName) {
- Tracing brave = braves.get(pattern);
- if (brave == null && !braves.containsKey(serviceName)) {
- brave = newTracing(serviceName);
- braves.put(serviceName, brave);
- }
- }
-
- private Tracing newTracing(String serviceName) {
- Tracing brave = null;
- if (camelContext.isUseMDCLogging()) {
- brave = Tracing.newBuilder()
- .currentTraceContext(
- ThreadLocalCurrentTraceContext.newBuilder().addScopeDecorator(MDCScopeDecorator.create()).build())
- .localServiceName(serviceName).sampler(Sampler.create(rate)).spanReporter(spanReporter).build();
- } else {
- brave = Tracing.newBuilder().localServiceName(serviceName).sampler(Sampler.create(rate)).spanReporter(spanReporter)
- .build();
- }
- return brave;
- }
-
- private Tracing getTracing(String serviceName) {
- Tracing brave = null;
- if (serviceName != null) {
- brave = braves.get(serviceName);
-
- if (brave == null && useFallbackServiceNames) {
- LOG.debug("Creating Tracing assigned to serviceName: {} as fallback", serviceName);
- brave = newTracing(serviceName);
- braves.put(serviceName, brave);
- }
- }
-
- return brave;
- }
-
- private void clientRequest(Tracing brave, String serviceName, ExchangeSendingEvent event) {
- // reuse existing span if we do multiple requests from the same
- ExtendedExchange exchange = event.getExchange().adapt(ExtendedExchange.class);
- ZipkinState state = exchange.getSafeCopyProperty(ZipkinState.KEY, ZipkinState.class);
- if (state == null) {
- state = new ZipkinState();
- exchange.setSafeCopyProperty(ZipkinState.KEY, state);
- }
- // if we started from a server span then lets reuse that when we call a
- // downstream service
- Span last = state.peekServerSpan();
- Span span;
- if (last != null) {
- span = brave.tracer().newChild(last.context());
- } else {
- span = brave.tracer().nextSpan();
- }
- Span.Kind spanKind = getProducerComponentSpanKind(event.getEndpoint());
- span.kind(spanKind).start();
-
- ZipkinClientRequestAdapter parser = new ZipkinClientRequestAdapter(this, event.getEndpoint());
- CamelRequest request = new CamelRequest(event.getExchange().getIn(), spanKind);
- INJECTOR.inject(span.context(), request);
- parser.onRequest(event.getExchange(), span.customizer());
-
- // store span after request
- state.pushClientSpan(span);
- TraceContext context = span.context();
- String traceId = "" + context.traceIdString();
- String spanId = "" + context.spanId();
- String parentId = context.parentId() != null ? "" + context.parentId() : null;
- if (camelContext.isUseMDCLogging()) {
- MDC.put("traceId", traceId);
- MDC.put("spanId", spanId);
- MDC.put("parentId", parentId);
- }
- if (LOG.isDebugEnabled()) {
- if (parentId != null) {
- LOG.debug(String.format("clientRequest [service=%s, traceId=%20s, spanId=%20s, parentId=%20s]", serviceName,
- traceId, spanId, parentId));
- } else {
- LOG.debug(String.format("clientRequest [service=%s, traceId=%20s, spanId=%20s]", serviceName, traceId, spanId));
- }
- }
- }
-
- //protected for testing
- protected Kind getProducerComponentSpanKind(Endpoint endpoint) {
- return producerComponentToSpanKind.getOrDefault(getComponentName(endpoint), Span.Kind.CLIENT);
- }
-
- //protected for testing
- protected void addProducerComponentSpanKind(String component, Span.Kind kind) {
- producerComponentToSpanKind.putIfAbsent(component, kind);
- }
-
- private void clientResponse(String serviceName, ExchangeSentEvent event) {
- Span span = null;
- ExtendedExchange exchange = event.getExchange().adapt(ExtendedExchange.class);
- ZipkinState state = exchange.getSafeCopyProperty(ZipkinState.KEY, ZipkinState.class);
- if (state != null) {
- // only process if it was a zipkin client event
- span = state.popClientSpan();
- }
-
- if (span != null) {
- ZipkinClientResponseAdaptor parser = new ZipkinClientResponseAdaptor(this, event.getEndpoint());
- parser.onResponse(event.getExchange(), span.customizer());
- span.finish();
- TraceContext context = span.context();
- String traceId = "" + context.traceIdString();
- String spanId = "" + context.spanId();
- String parentId = context.parentId() != null ? "" + context.parentId() : null;
- if (camelContext.isUseMDCLogging()) {
- MDC.put("traceId", traceId);
- MDC.put("spanId", spanId);
- MDC.put("parentId", parentId);
- }
- if (LOG.isDebugEnabled()) {
- if (parentId != null) {
- LOG.debug(String.format("clientResponse[service=%s, traceId=%20s, spanId=%20s, parentId=%20s]", serviceName,
- traceId, spanId, parentId));
- } else {
- LOG.debug(String.format("clientResponse[service=%s, traceId=%20s, spanId=%20s]", serviceName, traceId,
- spanId));
- }
- }
- }
- }
-
- private Span serverRequest(Tracing brave, String serviceName, Exchange exchange) {
- // reuse existing span if we do multiple requests from the same
- ExtendedExchange extendedExchange = exchange.adapt(ExtendedExchange.class);
- ZipkinState state = extendedExchange.getSafeCopyProperty(ZipkinState.KEY, ZipkinState.class);
- if (state == null) {
- state = new ZipkinState();
- extendedExchange.setSafeCopyProperty(ZipkinState.KEY, state);
- }
- Span span = null;
- Span.Kind spanKind = getConsumerComponentSpanKind(exchange.getFromEndpoint());
- CamelRequest cr = new CamelRequest(exchange.getIn(), spanKind);
- TraceContextOrSamplingFlags sampleFlag = EXTRACTOR.extract(cr);
- if (ObjectHelper.isEmpty(sampleFlag)) {
- span = brave.tracer().nextSpan();
- } else {
- span = brave.tracer().nextSpan(sampleFlag);
- }
- span.kind(spanKind).start();
- ZipkinServerRequestAdapter parser = new ZipkinServerRequestAdapter(this, exchange);
- parser.onRequest(exchange, span.customizer());
- INJECTOR.inject(span.context(), cr);
- // store span after request
- state.pushServerSpan(span);
- TraceContext context = span.context();
- String traceId = "" + context.traceIdString();
- String spanId = "" + context.spanId();
- String parentId = context.parentId() != null ? "" + context.parentId() : null;
- if (camelContext.isUseMDCLogging()) {
- MDC.put("traceId", traceId);
- MDC.put("spanId", spanId);
- MDC.put("parentId", parentId);
- }
- if (LOG.isDebugEnabled()) {
- if (parentId != null) {
- LOG.debug(String.format("serverRequest [service=%s, traceId=%20s, spanId=%20s, parentId=%20s]", serviceName,
- traceId, spanId, parentId));
- } else {
- LOG.debug(String.format("serverRequest [service=%s, traceId=%20s, spanId=%20s]", serviceName, traceId, spanId));
- }
- }
-
- return span;
- }
-
- //protected for testing
- protected Kind getConsumerComponentSpanKind(Endpoint endpoint) {
- return consumerComponentToSpanKind.getOrDefault(getComponentName(endpoint), Span.Kind.SERVER);
- }
-
- private void serverResponse(String serviceName, Exchange exchange) {
- Span span = null;
- ExtendedExchange extendedExchange = exchange.adapt(ExtendedExchange.class);
- ZipkinState state = extendedExchange.getSafeCopyProperty(ZipkinState.KEY, ZipkinState.class);
- if (state != null) {
- // only process if it was a zipkin server event
- span = state.popServerSpan();
- }
-
- if (span != null) {
- ZipkinServerResponseAdapter parser = new ZipkinServerResponseAdapter(this, exchange);
- parser.onResponse(exchange, span.customizer());
- span.finish();
- TraceContext context = span.context();
- String traceId = "" + context.traceIdString();
- String spanId = "" + context.spanId();
- String parentId = context.parentId() != null ? "" + context.parentId() : null;
- if (camelContext.isUseMDCLogging()) {
- MDC.put("traceId", traceId);
- MDC.put("spanId", spanId);
- MDC.put("parentId", parentId);
- }
- if (LOG.isDebugEnabled()) {
- if (parentId != null) {
- LOG.debug(String.format("serverResponse[service=%s, traceId=%20s, spanId=%20s, parentId=%20s]", serviceName,
- traceId, spanId, parentId));
- } else {
- LOG.debug(String.format("serverResponse[service=%s, traceId=%20s, spanId=%20s]", serviceName, traceId,
- spanId));
- }
- }
- }
- }
-
- private String getComponentName(Endpoint endpoint) {
- String uri = endpoint.getEndpointBaseUri();
- if (uri != null) {
- String uriParts[] = uri.split(":");
- if (uriParts != null && uriParts.length > 0) {
- return uriParts[0].toLowerCase();
- }
- }
- return null;
- }
-
- private final class ZipkinEventNotifier extends EventNotifierSupport {
-
- @Override
- public void notify(CamelEvent event) throws Exception {
- // use event notifier to track events when Camel messages to
- // endpoints
- // these events corresponds to Zipkin client events
-
- // client events
- if (event instanceof ExchangeSendingEvent) {
- ExchangeSendingEvent ese = (ExchangeSendingEvent) event;
- String serviceName = getServiceName(ese.getExchange(), ese.getEndpoint(), false, true);
- Tracing brave = getTracing(serviceName);
- if (brave != null) {
- clientRequest(brave, serviceName, ese);
- }
- } else if (event instanceof ExchangeSentEvent) {
- ExchangeSentEvent ese = (ExchangeSentEvent) event;
- String serviceName = getServiceName(ese.getExchange(), ese.getEndpoint(), false, true);
- Tracing brave = getTracing(serviceName);
- if (brave != null) {
- clientResponse(serviceName, ese);
- }
- }
- }
-
- @Override
- public boolean isEnabled(CamelEvent event) {
- switch (event.getType()) {
- case ExchangeSending:
- case ExchangeSent:
- case ExchangeCreated:
- case ExchangeCompleted:
- case ExchangeFailed:
- return true;
- default:
- return false;
- }
- }
-
- @Override
- public String toString() {
- return "ZipkinEventNotifier";
- }
- }
-
- private final class ZipkinRoutePolicy extends RoutePolicySupport {
-
- @Override
- public void onExchangeBegin(Route route, Exchange exchange) {
- // use route policy to track events when Camel a Camel route
- // begins/end the lifecycle of an Exchange
- // these events corresponds to Zipkin server events
-
- String serviceName = getServiceName(exchange, route.getEndpoint(), true, false);
- Tracing brave = getTracing(serviceName);
- if (brave != null) {
- serverRequest(brave, serviceName, exchange);
- }
-
- }
-
- // Report Server send after route has completed processing of the
- // exchange.
- @Override
- public void onExchangeDone(Route route, Exchange exchange) {
- String serviceName = getServiceName(exchange, route.getEndpoint(), true, false);
- Tracing brave = getTracing(serviceName);
- if (brave != null) {
- serverResponse(serviceName, exchange);
- }
- }
- }
-
- private static Expression routeIdExpression() {
- return new Expression() {
- @Override
- public <T> T evaluate(Exchange exchange, Class<T> type) {
- String answer = ExchangeHelper.getRouteId(exchange);
- return type.cast(answer);
- }
- };
- }
-
-}
diff --git a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/CamelRequestTest.java b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/CamelRequestTest.java
deleted file mode 100644
index 06464eeee58..00000000000
--- a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/CamelRequestTest.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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.zipkin;
-
-import brave.Span;
-import org.apache.camel.Message;
-import org.junit.jupiter.api.Test;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-public class CamelRequestTest {
-
- @Test
- public void testCamelRequest() {
- Message message = mock(Message.class);
- when(message.getHeader("X-B3-TraceId", String.class)).thenReturn("924c5b125daaaec8");
- CamelRequest request = new CamelRequest(message, Span.Kind.PRODUCER);
- request.setHeader("X-B3-SpanId", "db1ccb94946711b0");
- assertThat(request.spanKind()).isEqualTo(Span.Kind.PRODUCER);
- assertThat(request.unwrap()).isEqualTo(message);
- verify(message).setHeader("X-B3-SpanId", "db1ccb94946711b0");
- assertThat(request.getHeader("X-B3-TraceId")).isEqualTo("924c5b125daaaec8");
- }
-
-}
diff --git a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/LogSpanReporterTest.java b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/LogSpanReporterTest.java
deleted file mode 100644
index bc88090e6fd..00000000000
--- a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/LogSpanReporterTest.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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.zipkin;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import zipkin2.reporter.Reporter;
-
-public class LogSpanReporterTest<S> implements Reporter<S> {
-
- Logger log = LoggerFactory.getLogger(LogSpanReporterTest.class);
-
- @Override
- public void report(S span) {
- log.info(span.toString());
- }
-}
diff --git a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ManagedZipkinSimpleRouteTest.java b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ManagedZipkinSimpleRouteTest.java
deleted file mode 100644
index 7c6fc6b973b..00000000000
--- a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ManagedZipkinSimpleRouteTest.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * 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.zipkin;
-
-import java.util.concurrent.TimeUnit;
-
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.RoutesBuilder;
-import org.apache.camel.builder.NotifyBuilder;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.condition.DisabledOnOs;
-import org.junit.jupiter.api.condition.OS;
-import zipkin2.reporter.Reporter;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-@DisabledOnOs(OS.AIX)
-public class ManagedZipkinSimpleRouteTest extends CamelTestSupport {
-
- private ZipkinTracer zipkin;
-
- protected void setSpanReporter(ZipkinTracer zipkin) {
- zipkin.setSpanReporter(Reporter.NOOP);
- }
-
- @Override
- protected boolean useJmx() {
- return true;
- }
-
- protected MBeanServer getMBeanServer() {
- return context.getManagementStrategy().getManagementAgent().getMBeanServer();
- }
-
- @Override
- protected CamelContext createCamelContext() throws Exception {
- CamelContext context = super.createCamelContext();
-
- zipkin = new ZipkinTracer();
- zipkin.setServiceName("dude");
- setSpanReporter(zipkin);
-
- // attaching ourself to CamelContext
- zipkin.init(context);
-
- return context;
- }
-
- @Test
- public void testZipkinRoute() throws Exception {
- MBeanServer mbeanServer = getMBeanServer();
- ObjectName on = new ObjectName(
- "org.apache.camel:context=" + context.getManagementName() + ",type=services,name=ZipkinTracer");
- assertNotNull(on);
- assertTrue(mbeanServer.isRegistered(on));
-
- Float rate = (Float) mbeanServer.getAttribute(on, "Rate");
- assertEquals(1.0f, rate.floatValue(), 0.1f, "Should be 1.0f");
-
- 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));
- }
-
- @Override
- protected RoutesBuilder createRouteBuilder() {
- return new RouteBuilder() {
- @Override
- public void configure() {
- from("seda:dude").routeId("dude")
- .log("routing at ${routeId}")
- .delay(simple("${random(10,20)}"));
- }
- };
- }
-}
diff --git a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/SpringZipkinSimpleRouteTest.java b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/SpringZipkinSimpleRouteTest.java
deleted file mode 100644
index 107ce7952f7..00000000000
--- a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/SpringZipkinSimpleRouteTest.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * 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.zipkin;
-
-import java.util.concurrent.TimeUnit;
-
-import org.apache.camel.builder.NotifyBuilder;
-import org.apache.camel.test.spring.junit5.CamelSpringTestSupport;
-import org.junit.jupiter.api.Test;
-import org.springframework.context.support.AbstractApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
-
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-public class SpringZipkinSimpleRouteTest extends CamelSpringTestSupport {
-
- @Override
- protected AbstractApplicationContext createApplicationContext() {
- return new ClassPathXmlApplicationContext("org/apache/camel/zipkin/SpringZipkinSimpleRouteTest.xml");
- }
-
- @Test
- public void testZipkinRoute() {
- NotifyBuilder notify = new NotifyBuilder(context).whenDone(5).create();
-
- for (int i = 0; i < 5; i++) {
- template.sendBody("direct:start", "Hello World");
- }
-
- assertTrue(notify.matches(30, TimeUnit.SECONDS));
- }
-}
diff --git a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinABCRouteTest.java b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinABCRouteTest.java
deleted file mode 100644
index 202e2ca4639..00000000000
--- a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinABCRouteTest.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * 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.zipkin;
-
-import java.util.concurrent.TimeUnit;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.RoutesBuilder;
-import org.apache.camel.builder.NotifyBuilder;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Test;
-import zipkin2.reporter.Reporter;
-
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-public class ZipkinABCRouteTest extends CamelTestSupport {
-
- private ZipkinTracer zipkin;
-
- protected void setSpanReporter(ZipkinTracer zipkin) {
- zipkin.setSpanReporter(Reporter.NOOP);
- }
-
- @Override
- protected CamelContext createCamelContext() throws Exception {
- CamelContext context = super.createCamelContext();
-
- zipkin = new ZipkinTracer();
-
- zipkin.addClientServiceMapping("seda:a", "a");
- zipkin.addClientServiceMapping("seda:b", "b");
- zipkin.addClientServiceMapping("seda:c", "c");
- zipkin.addServerServiceMapping("seda:a", "a");
- zipkin.addServerServiceMapping("seda:b", "b");
- zipkin.addServerServiceMapping("seda:c", "c");
- setSpanReporter(zipkin);
-
- // attaching ourself to CamelContext
- zipkin.init(context);
-
- return context;
- }
-
- @Test
- public void testZipkinRoute() {
- NotifyBuilder notify = new NotifyBuilder(context).whenDone(1).create();
-
- template.requestBody("direct:start", "Hello World");
-
- assertTrue(notify.matches(30, TimeUnit.SECONDS));
- }
-
- @Override
- protected RoutesBuilder createRouteBuilder() {
- return new RouteBuilder() {
- @Override
- public void configure() {
- from("direct:start").to("seda:a").routeId("start");
-
- from("seda: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")
- .log("routing at ${routeId}")
- .delay(simple("${random(0,100)}"));
- }
- };
- }
-}
diff --git a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinClientCustomTagsTest.java b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinClientCustomTagsTest.java
deleted file mode 100644
index 4d33834f448..00000000000
--- a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinClientCustomTagsTest.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * 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.zipkin;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.Exchange;
-import org.apache.camel.Processor;
-import org.apache.camel.RoutesBuilder;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Test;
-import zipkin2.reporter.Reporter;
-
-public class ZipkinClientCustomTagsTest extends CamelTestSupport {
-
- private ZipkinTracer zipkin;
-
- protected void setSpanReporter(ZipkinTracer zipkin) {
- zipkin.setSpanReporter(Reporter.NOOP);
- }
-
- @Override
- protected CamelContext createCamelContext() throws Exception {
- CamelContext context = super.createCamelContext();
- zipkin = new ZipkinTracer();
- // we have 2 routes as services
- zipkin.addClientServiceMapping("seda:a", "a");
- zipkin.addServerServiceMapping("seda:a", "a");
- setSpanReporter(zipkin);
-
- // attaching ourself to CamelContext
- zipkin.init(context);
- return context;
- }
-
- @Test
- public void testZipkinRoute() {
- template.requestBody("direct:start", "Camel client sends custom tags");
- }
-
- @Override
- protected RoutesBuilder createRouteBuilder() {
- return new RouteBuilder() {
- @Override
- public void configure() {
- from("direct:start").to("seda:a");
-
- from("seda:a").routeId("a")
- .setBody().constant("Camel client sends custom tags")
- .process(new Processor() {
- public void process(Exchange exchange) {
- Map<String, String> customTags = new HashMap<>();
- customTags.put("customTag1", "value1");
- customTags.put("customTag2", "value2");
- exchange.setProperty("camel.client.customtags", customTags);
- }
- });
- }
- };
- }
-}
diff --git a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinClientRecipientListRouteTest.java b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinClientRecipientListRouteTest.java
deleted file mode 100644
index dcd186c57a4..00000000000
--- a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinClientRecipientListRouteTest.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * 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.zipkin;
-
-import java.util.concurrent.TimeUnit;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.RoutesBuilder;
-import org.apache.camel.builder.NotifyBuilder;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Test;
-import zipkin2.reporter.Reporter;
-
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-public class ZipkinClientRecipientListRouteTest extends CamelTestSupport {
-
- private ZipkinTracer zipkin;
-
- protected void setSpanReporter(ZipkinTracer zipkin) {
- zipkin.setSpanReporter(Reporter.NOOP);
- }
-
- @Override
- protected CamelContext createCamelContext() throws Exception {
- CamelContext context = super.createCamelContext();
-
- zipkin = new ZipkinTracer();
-
- zipkin.addClientServiceMapping("seda:a", "a");
- zipkin.addClientServiceMapping("seda:b", "b");
- zipkin.addClientServiceMapping("seda:c", "c");
- zipkin.addServerServiceMapping("seda:a", "a");
- zipkin.addServerServiceMapping("seda:b", "b");
- zipkin.addServerServiceMapping("seda:c", "c");
- setSpanReporter(zipkin);
-
- // attaching ourself to CamelContext
- zipkin.init(context);
-
- return context;
- }
-
- @Test
- public void testZipkinRoute() {
- NotifyBuilder notify = new NotifyBuilder(context).whenDone(1).create();
-
- template.requestBody("direct:start", "Hello World");
-
- assertTrue(notify.matches(30, TimeUnit.SECONDS));
- }
-
- @Override
- protected RoutesBuilder createRouteBuilder() {
- return new RouteBuilder() {
- @Override
- public void configure() {
- from("direct:start").recipientList(constant("seda:a,seda:b,seda:c")).routeId("start");
-
- 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)}"));
- }
- };
- }
-}
diff --git a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinMDCScopeDecoratorTest.java b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinMDCScopeDecoratorTest.java
deleted file mode 100644
index b73bcaee667..00000000000
--- a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinMDCScopeDecoratorTest.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * 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.zipkin;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.Exchange;
-import org.apache.camel.Processor;
-import org.apache.camel.RoutesBuilder;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Test;
-import org.slf4j.MDC;
-import zipkin2.reporter.Reporter;
-
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-
-public class ZipkinMDCScopeDecoratorTest extends CamelTestSupport {
-
- private ZipkinTracer zipkin;
-
- protected void setSpanReporter(ZipkinTracer zipkin) {
- zipkin.setSpanReporter(Reporter.NOOP);
- }
-
- @Override
- protected CamelContext createCamelContext() throws Exception {
- CamelContext context = super.createCamelContext();
- zipkin = new ZipkinTracer();
- // we have 2 routes as services
- zipkin.addClientServiceMapping("seda:cat", "cat");
- zipkin.addServerServiceMapping("seda:cat", "cat");
- // capture message body as well
- zipkin.setIncludeMessageBody(true);
- setSpanReporter(zipkin);
- context.setUseMDCLogging(true);
- // attaching ourself to CamelContext
- zipkin.init(context);
- return context;
- }
-
- @Test
- public void testZipkinRoute() {
- template.requestBody("direct:start", "Camel say hello Cat");
- }
-
- @Override
- protected RoutesBuilder createRouteBuilder() {
- return new RouteBuilder() {
- @Override
- public void configure() {
- from("direct:start").to("seda:cat");
-
- from("seda:cat").routeId("cat")
- .setBody().constant("Cat says hello Dog")
- .process(new Processor() {
- public void process(Exchange exchange) {
- assertNotNull(MDC.get("traceId"));
- assertNotNull(MDC.get("spanId"));
- assertNotNull(MDC.get("parentId"));
- }
- });
- }
- };
- }
-}
diff --git a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinMultiServerNoClientTest.java b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinMultiServerNoClientTest.java
deleted file mode 100644
index cbc15e9026a..00000000000
--- a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinMultiServerNoClientTest.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * 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.zipkin;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.RoutesBuilder;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Test;
-import zipkin2.reporter.Reporter;
-
-public class ZipkinMultiServerNoClientTest extends CamelTestSupport {
-
- private ZipkinTracer zipkin;
-
- protected void setSpanReporter(ZipkinTracer zipkin) {
- zipkin.setSpanReporter(Reporter.NOOP);
- }
-
- @Override
- protected CamelContext createCamelContext() throws Exception {
- CamelContext context = super.createCamelContext();
- zipkin = new ZipkinTracer();
- // we have one route as service
- zipkin.addServerServiceMapping("seda:abc", "abc");
- zipkin.addServerServiceMapping("seda:xyz", "xyz");
- setSpanReporter(zipkin);
- // attaching ourself to CamelContext
- zipkin.init(context);
- return context;
- }
-
- @Test
- public void testZipkinRoute() {
- template.requestBody("direct:start", "Hello abc");
- }
-
- @Override
- protected RoutesBuilder createRouteBuilder() {
- return new RouteBuilder() {
- @Override
- public void configure() {
- from("direct:start").to("seda:abc");
-
- from("seda:abc").routeId("abc")
- .log("routing at ${routeId}")
- .multicast()
- .to("seda:xyz")
- .end()
- .log("End of routing");
-
- from("seda:xyz").routeId("xyz")
- .log("routing at ${routeId}")
- .delay(simple("${random(1000,2000)}"));
- }
- };
- }
-}
diff --git a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinMulticastRouteTest.java b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinMulticastRouteTest.java
deleted file mode 100644
index 1199a40cbfe..00000000000
--- a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinMulticastRouteTest.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * 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.zipkin;
-
-import java.util.concurrent.TimeUnit;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.RoutesBuilder;
-import org.apache.camel.builder.NotifyBuilder;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Test;
-import zipkin2.reporter.Reporter;
-
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-public class ZipkinMulticastRouteTest extends CamelTestSupport {
-
- private ZipkinTracer zipkin;
-
- protected void setSpanReporter(ZipkinTracer zipkin) {
- zipkin.setSpanReporter(Reporter.NOOP);
- }
-
- @Override
- protected CamelContext createCamelContext() throws Exception {
- CamelContext context = super.createCamelContext();
-
- zipkin = new ZipkinTracer();
-
- zipkin.addClientServiceMapping("seda:a", "a");
- zipkin.addClientServiceMapping("seda:b", "b");
- zipkin.addClientServiceMapping("seda:c", "c");
- zipkin.addServerServiceMapping("seda:a", "a");
- zipkin.addServerServiceMapping("seda:b", "b");
- zipkin.addServerServiceMapping("seda:c", "c");
- setSpanReporter(zipkin);
-
- // attaching ourself to CamelContext
- zipkin.init(context);
-
- return context;
- }
-
- @Test
- public void testZipkinRoute() {
- NotifyBuilder notify = new NotifyBuilder(context).whenDone(1).create();
-
- template.requestBody("direct:start", "Hello World");
-
- assertTrue(notify.matches(30, TimeUnit.SECONDS));
- }
-
- @Override
- protected RoutesBuilder createRouteBuilder() {
- return new RouteBuilder() {
- @Override
- public void configure() {
- from("direct:start").to("seda:a").routeId("start");
-
- 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")
- .log("routing at ${routeId}")
- .delay(simple("${random(0,100)}"));
- }
- };
- }
-}
diff --git a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinOneRouteFallbackTest.java b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinOneRouteFallbackTest.java
deleted file mode 100644
index 12621934465..00000000000
--- a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinOneRouteFallbackTest.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * 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.zipkin;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.RoutesBuilder;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Test;
-import zipkin2.reporter.Reporter;
-
-public class ZipkinOneRouteFallbackTest extends CamelTestSupport {
-
- private ZipkinTracer zipkin;
-
- protected void setSpanReporter(ZipkinTracer zipkin) {
- zipkin.setSpanReporter(Reporter.NOOP);
- }
-
- @Override
- protected CamelContext createCamelContext() throws Exception {
- CamelContext context = super.createCamelContext();
-
- zipkin = new ZipkinTracer();
- // no service so should use fallback naming style
- // we do not want to trace any direct endpoints
- zipkin.addExcludePattern("direct:*");
- zipkin.setIncludeMessageBody(true);
- setSpanReporter(zipkin);
-
- // attaching ourself to CamelContext
- zipkin.init(context);
-
- return context;
- }
-
- @Test
- public void testZipkinRoute() {
- template.requestBody("direct:start", "Hello Goofy");
- template.requestBody("direct:start", "Hello again Goofy");
- }
-
- @Override
- protected RoutesBuilder createRouteBuilder() {
- return new RouteBuilder() {
- @Override
- public void configure() {
- from("direct:start").to("seda:goofy");
-
- from("seda:goofy").routeId("goofy")
- .log("routing at ${routeId}")
- .delay(simple("${random(1000,2000)}"));
- }
- };
- }
-}
diff --git a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinOneRouteTest.java b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinOneRouteTest.java
deleted file mode 100644
index 17c308fea6c..00000000000
--- a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinOneRouteTest.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * 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.zipkin;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.RoutesBuilder;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Test;
-import zipkin2.reporter.Reporter;
-
-public class ZipkinOneRouteTest extends CamelTestSupport {
-
- private ZipkinTracer zipkin;
-
- protected void setSpanReporter(ZipkinTracer zipkin) {
- zipkin.setSpanReporter(Reporter.NOOP);
- }
-
- @Override
- protected CamelContext createCamelContext() throws Exception {
- CamelContext context = super.createCamelContext();
-
- zipkin = new ZipkinTracer();
- // we have one route as service
- zipkin.addClientServiceMapping("seda:cat", "cat");
- zipkin.addServerServiceMapping("seda:cat", "cat");
- setSpanReporter(zipkin);
-
- // attaching ourself to CamelContext
- zipkin.init(context);
-
- return context;
- }
-
- @Test
- public void testZipkinRoute() {
- template.requestBody("direct:start", "Hello Cat");
- }
-
- @Override
- protected RoutesBuilder createRouteBuilder() {
- return new RouteBuilder() {
- @Override
- public void configure() {
- from("direct:start").to("seda:cat");
-
- from("seda:cat").routeId("cat")
- .log("routing at ${routeId}")
- .delay(simple("${random(1000,2000)}"));
- }
- };
- }
-}
diff --git a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinProducerSpanKindTest.java b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinProducerSpanKindTest.java
deleted file mode 100644
index 317657b19c1..00000000000
--- a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinProducerSpanKindTest.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * 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.zipkin;
-
-import brave.Span;
-import org.apache.camel.CamelContext;
-import org.apache.camel.Exchange;
-import org.apache.camel.Processor;
-import org.apache.camel.RoutesBuilder;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.assertj.core.api.Assertions;
-import org.junit.jupiter.api.Test;
-import zipkin2.reporter.Reporter;
-
-public class ZipkinProducerSpanKindTest extends CamelTestSupport {
-
- private ZipkinTracer zipkin;
-
- protected void setSpanReporter(ZipkinTracer zipkin) {
- zipkin.setSpanReporter(Reporter.NOOP);
- }
-
- @Override
- protected CamelContext createCamelContext() throws Exception {
- CamelContext context = super.createCamelContext();
-
- zipkin = new ZipkinTracer();
- zipkin.addProducerComponentSpanKind("seda", Span.Kind.PRODUCER);
- setSpanReporter(zipkin);
-
- // attaching ourself to CamelContext
- zipkin.init(context);
-
- return context;
- }
-
- @Test
- public void testB3SingleHeaderPresent() {
- template.requestBody("direct:start", "Hello World");
- }
-
- @Override
- protected RoutesBuilder createRouteBuilder() {
- return new RouteBuilder() {
- @Override
- public void configure() {
- from("direct:start").to("seda:a").routeId("start");
-
- from("seda:a").routeId("a")
- .process(new Processor() {
- @Override
- public void process(Exchange exchange) {
- String b3Header = exchange.getIn().getHeader("b3", String.class);
- Assertions.assertThat(b3Header).isNotNull();
- }
- });
- }
- };
- }
-
-}
diff --git a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinRecipientListRouteTest.java b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinRecipientListRouteTest.java
deleted file mode 100644
index 498a2d376f4..00000000000
--- a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinRecipientListRouteTest.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * 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.zipkin;
-
-import java.util.concurrent.TimeUnit;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.RoutesBuilder;
-import org.apache.camel.builder.NotifyBuilder;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Test;
-import zipkin2.reporter.Reporter;
-
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-public class ZipkinRecipientListRouteTest extends CamelTestSupport {
-
- private ZipkinTracer zipkin;
-
- protected void setSpanReporter(ZipkinTracer zipkin) {
- zipkin.setSpanReporter(Reporter.NOOP);
- }
-
- @Override
- protected CamelContext createCamelContext() throws Exception {
- CamelContext context = super.createCamelContext();
-
- zipkin = new ZipkinTracer();
-
- zipkin.addClientServiceMapping("seda:a", "a");
- zipkin.addClientServiceMapping("seda:b", "b");
- zipkin.addClientServiceMapping("seda:c", "c");
- zipkin.addServerServiceMapping("seda:a", "a");
- zipkin.addServerServiceMapping("seda:b", "b");
- zipkin.addServerServiceMapping("seda:c", "c");
- setSpanReporter(zipkin);
-
- // attaching ourself to CamelContext
- zipkin.init(context);
-
- return context;
- }
-
- @Test
- public void testZipkinRoute() {
- NotifyBuilder notify = new NotifyBuilder(context).whenDone(1).create();
-
- template.requestBody("direct:start", "Hello World");
-
- assertTrue(notify.matches(30, TimeUnit.SECONDS));
- }
-
- @Override
- protected RoutesBuilder createRouteBuilder() {
- return new RouteBuilder() {
- @Override
- public void configure() {
- from("direct:start").to("seda:a").routeId("start");
-
- from("seda:a").routeId("a")
- .log("routing at ${routeId}")
- .recipientList(constant("seda:b,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")
- .log("routing at ${routeId}")
- .delay(simple("${random(0,100)}"));
- }
- };
- }
-}
diff --git a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinRouteConcurrentTest.java b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinRouteConcurrentTest.java
deleted file mode 100644
index 73398f07a10..00000000000
--- a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinRouteConcurrentTest.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * 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.zipkin;
-
-import java.util.concurrent.TimeUnit;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.RoutesBuilder;
-import org.apache.camel.builder.NotifyBuilder;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Test;
-import zipkin2.reporter.Reporter;
-
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-public class ZipkinRouteConcurrentTest extends CamelTestSupport {
-
- private ZipkinTracer zipkin;
-
- protected void setSpanReporter(ZipkinTracer zipkin) {
- zipkin.setSpanReporter(Reporter.NOOP);
- }
-
- @Override
- protected CamelContext createCamelContext() throws Exception {
- CamelContext context = super.createCamelContext();
-
- zipkin = new ZipkinTracer();
- zipkin.addClientServiceMapping("seda:foo", "foo");
- zipkin.addServerServiceMapping("seda:bar", "bar");
- setSpanReporter(zipkin);
-
- // attaching ourself to CamelContext
- zipkin.init(context);
-
- return context;
- }
-
- @Test
- public void testZipkinRoute() {
- NotifyBuilder notify = new NotifyBuilder(context).whenDone(5).create();
-
- for (int i = 0; i < 5; i++) {
- template.sendBody("seda:foo", "Hello World");
- }
-
- assertTrue(notify.matches(30, TimeUnit.SECONDS));
- }
-
- @Override
- protected RoutesBuilder createRouteBuilder() {
- return new RouteBuilder() {
- @Override
- public void configure() {
- 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)}"));
- }
- };
- }
-}
diff --git a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinServerMulticastTest.java b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinServerMulticastTest.java
deleted file mode 100644
index 1b0302d6718..00000000000
--- a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinServerMulticastTest.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * 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.zipkin;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.RoutesBuilder;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Test;
-import zipkin2.reporter.Reporter;
-
-public class ZipkinServerMulticastTest extends CamelTestSupport {
-
- private ZipkinTracer zipkin;
-
- protected void setSpanReporter(ZipkinTracer zipkin) {
- zipkin.setSpanReporter(Reporter.NOOP);
- }
-
- @Override
- protected CamelContext createCamelContext() throws Exception {
- CamelContext context = super.createCamelContext();
- zipkin = new ZipkinTracer();
- // we have one route as service
- zipkin.addClientServiceMapping("seda:abc", "abc");
- zipkin.addServerServiceMapping("seda:xyz", "xyz");
- zipkin.addServerServiceMapping("seda:cat", "cat");
- zipkin.addServerServiceMapping("seda:dog", "dog");
- setSpanReporter(zipkin);
- // attaching ourself to CamelContext
- zipkin.init(context);
- return context;
- }
-
- @Test
- public void testZipkinRoute() {
- template.requestBody("direct:start", "Hello abc");
- }
-
- @Override
- protected RoutesBuilder createRouteBuilder() {
- return new RouteBuilder() {
- @Override
- public void configure() {
- from("direct:start").to("seda:abc");
-
- from("seda:abc").routeId("abc")
- .log("routing at ${routeId}")
- .multicast()
- .to("seda:xyz")
- .to("seda:cat")
- .to("seda:dog")
- .end()
- .log("End of routing");
-
- from("seda:xyz").routeId("xyz")
- .log("routing at ${routeId}")
- .delay(simple("${random(1000,2000)}"));
-
- from("seda:cat").routeId("cat")
- .log("routing at ${routeId}")
- .delay(simple("${random(1000,2000)}"));
-
- from("seda:dog").routeId("b")
- .log("routing at ${routeId}")
- .delay(simple("${random(1000,2000)}"));
- }
- };
- }
-}
diff --git a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinSimpleFallbackRouteTest.java b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinSimpleFallbackRouteTest.java
deleted file mode 100644
index 2dee2f2678b..00000000000
--- a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinSimpleFallbackRouteTest.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * 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.zipkin;
-
-import java.util.concurrent.TimeUnit;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.RoutesBuilder;
-import org.apache.camel.builder.NotifyBuilder;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Test;
-import zipkin2.reporter.Reporter;
-
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-public class ZipkinSimpleFallbackRouteTest extends CamelTestSupport {
-
- private ZipkinTracer zipkin;
-
- protected void setSpanReporter(ZipkinTracer zipkin) {
- zipkin.setSpanReporter(Reporter.NOOP);
- }
-
- @Override
- protected CamelContext createCamelContext() throws Exception {
- CamelContext context = super.createCamelContext();
-
- zipkin = new ZipkinTracer();
- setSpanReporter(zipkin);
-
- // attaching ourself to CamelContext
- zipkin.init(context);
-
- return context;
- }
-
- @Test
- public void testZipkinRoute() {
- 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));
- }
-
- @Override
- protected RoutesBuilder createRouteBuilder() {
- return new RouteBuilder() {
- @Override
- public void configure() {
- from("seda:dude").routeId("dude")
- .log("routing at ${routeId}")
- .delay(simple("${random(1000,2000)}"));
- }
- };
- }
-}
diff --git a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinSimpleLogStreamsRouteTest.java b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinSimpleLogStreamsRouteTest.java
deleted file mode 100644
index 1f3c872bd39..00000000000
--- a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinSimpleLogStreamsRouteTest.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * 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.zipkin;
-
-import java.util.concurrent.TimeUnit;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.RoutesBuilder;
-import org.apache.camel.builder.NotifyBuilder;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Test;
-import zipkin2.reporter.Reporter;
-
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-public class ZipkinSimpleLogStreamsRouteTest extends CamelTestSupport {
-
- private ZipkinTracer zipkin;
-
- protected void setSpanReporter(ZipkinTracer zipkin) {
- zipkin.setSpanReporter(Reporter.NOOP);
- }
-
- @Override
- protected CamelContext createCamelContext() throws Exception {
- CamelContext context = super.createCamelContext();
-
- zipkin = new ZipkinTracer();
- zipkin.setServiceName("dude");
- zipkin.setIncludeMessageBodyStreams(true);
- setSpanReporter(zipkin);
-
- // attaching ourself to CamelContext
- zipkin.init(context);
-
- return context;
- }
-
- @Test
- public void testZipkinRoute() {
- 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));
- }
-
- @Override
- protected RoutesBuilder createRouteBuilder() {
- return new RouteBuilder() {
- @Override
- public void configure() {
- from("seda:dude").routeId("dude")
- .log("routing at ${routeId}")
- .delay(simple("${random(1000,2000)}"));
- }
- };
- }
-}
diff --git a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinSimpleRouteTest.java b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinSimpleRouteTest.java
deleted file mode 100644
index b3dc8ca2684..00000000000
--- a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinSimpleRouteTest.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * 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.zipkin;
-
-import java.util.concurrent.TimeUnit;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.RoutesBuilder;
-import org.apache.camel.builder.NotifyBuilder;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Test;
-import zipkin2.reporter.Reporter;
-
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-public class ZipkinSimpleRouteTest extends CamelTestSupport {
-
- private ZipkinTracer zipkin;
-
- protected void setSpanReporter(ZipkinTracer zipkin) {
- zipkin.setSpanReporter(Reporter.NOOP);
- }
-
- @Override
- protected CamelContext createCamelContext() throws Exception {
- CamelContext context = super.createCamelContext();
-
- zipkin = new ZipkinTracer();
- zipkin.setServiceName("dude");
- setSpanReporter(zipkin);
-
- // attaching ourself to CamelContext
- zipkin.init(context);
-
- return context;
- }
-
- @Test
- public void testZipkinRoute() {
- 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));
- }
-
- @Override
- protected RoutesBuilder createRouteBuilder() {
- return new RouteBuilder() {
- @Override
- public void configure() {
- from("seda:dude").routeId("dude")
- .log("routing at ${routeId}")
- .delay(simple("${random(1000,2000)}"));
- }
- };
- }
-}
diff --git a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinSpanReporterInRegistryTest.java b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinSpanReporterInRegistryTest.java
deleted file mode 100644
index 59eb802dbe7..00000000000
--- a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinSpanReporterInRegistryTest.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * 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.zipkin;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.spi.Registry;
-import org.apache.camel.support.SimpleRegistry;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Test;
-import zipkin2.reporter.Reporter;
-
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertSame;
-
-public class ZipkinSpanReporterInRegistryTest extends CamelTestSupport {
-
- private ZipkinTracer zipkin;
-
- @Override
- protected CamelContext createCamelContext() throws Exception {
- CamelContext context = super.createCamelContext();
-
- zipkin = new ZipkinTracer();
- zipkin.init(context);
-
- return context;
- }
-
- @Override
- protected Registry createCamelRegistry() {
- Registry registry = new SimpleRegistry();
- registry.bind("span", Reporter.NOOP);
- return registry;
- }
-
- @Test
- public void testZipkinConfiguration() {
- assertNotNull(zipkin.getSpanReporter());
- assertSame(Reporter.NOOP, zipkin.getSpanReporter());
- }
-
-}
diff --git a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinStateTest.java b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinStateTest.java
deleted file mode 100644
index 5ebfd69e972..00000000000
--- a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinStateTest.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * 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.zipkin;
-
-import brave.Span;
-import brave.Tracing;
-import brave.propagation.TraceContext;
-import brave.propagation.TraceContextOrSamplingFlags;
-import org.apache.camel.Exchange;
-import org.apache.camel.spring.SpringCamelContext;
-import org.apache.camel.support.DefaultExchange;
-import org.junit.jupiter.api.Test;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class ZipkinStateTest {
-
- private ZipkinState state = new ZipkinState();
-
- @Test
- public void testZipkinState() {
- TraceContext context = TraceContext.newBuilder().traceId(1L).spanId(2L).parentId(3L).build();
- TraceContextOrSamplingFlags sampling = TraceContextOrSamplingFlags.newBuilder(context).build();
- Tracing tracing = Tracing.newBuilder().build();
-
- Span span1 = tracing.tracer().nextSpan(sampling);
- state.pushServerSpan(span1);
-
- Span span2 = tracing.tracer().nextSpan(sampling);
- state.pushServerSpan(span2);
-
- Exchange exchange1 = new DefaultExchange(new SpringCamelContext());
- exchange1.getIn().setHeader(ZipkinConstants.TRACE_ID, context.traceIdString());
- exchange1.getIn().setHeader(ZipkinConstants.PARENT_SPAN_ID, context.spanIdString());
- exchange1.getIn().setHeader(ZipkinConstants.SPAN_ID, span1.context().spanIdString());
-
- Exchange exchange2 = new DefaultExchange(new SpringCamelContext());
- exchange2.getIn().setHeader(ZipkinConstants.TRACE_ID, context.traceIdString());
- exchange2.getIn().setHeader(ZipkinConstants.PARENT_SPAN_ID, context.spanIdString());
- exchange2.getIn().setHeader(ZipkinConstants.SPAN_ID, span2.context().spanIdString());
-
- Span retrived = state.peekServerSpan();
- assertThat(retrived.context().spanId()).isEqualTo(span2.context().spanId());
- assertThat(retrived.context().parentId()).isEqualTo(span2.context().parentId());
- assertThat(retrived.context().traceId()).isEqualTo(span2.context().traceId());
-
- state.popServerSpan();
-
- retrived = state.peekServerSpan();
- assertThat(retrived.context().spanId()).isEqualTo(span1.context().spanId());
- assertThat(retrived.context().parentId()).isEqualTo(span1.context().parentId());
- assertThat(retrived.context().traceId()).isEqualTo(span1.context().traceId());
-
- }
-
- @Test
- public void testZipkinStateSafeCopy() {
- TraceContext context = TraceContext.newBuilder().traceId(1L).spanId(2L).parentId(3L).build();
- TraceContextOrSamplingFlags sampling = TraceContextOrSamplingFlags.newBuilder(context).build();
- Tracing tracing = Tracing.newBuilder().build();
-
- Span span1 = tracing.tracer().nextSpan(sampling);
- state.pushServerSpan(span1);
-
- Span span2 = tracing.tracer().nextSpan(sampling);
- state.pushServerSpan(span2);
-
- Span span3 = tracing.tracer().nextSpan(sampling);
- ZipkinState state2 = state.safeCopy();
- state2.pushServerSpan(span3);
-
- //original object intact
- assertThat(state.peekServerSpan().context()).isNotEqualTo(span3.context()).usingRecursiveComparison();
-
- //new object has the new span
- assertThat(state2.peekServerSpan().context()).isEqualTo(span3.context()).usingRecursiveComparison();
-
- }
-
-}
diff --git a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinTimerRouteTest.java b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinTimerRouteTest.java
deleted file mode 100644
index 82a9d201135..00000000000
--- a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinTimerRouteTest.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * 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.zipkin;
-
-import java.util.concurrent.TimeUnit;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.ExchangePattern;
-import org.apache.camel.RoutesBuilder;
-import org.apache.camel.builder.NotifyBuilder;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Test;
-import zipkin2.reporter.Reporter;
-
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-public class ZipkinTimerRouteTest extends CamelTestSupport {
-
- private ZipkinTracer zipkin;
-
- protected void setSpanReporter(ZipkinTracer zipkin) {
- zipkin.setSpanReporter(Reporter.NOOP);
- }
-
- @Override
- protected CamelContext createCamelContext() throws Exception {
- CamelContext context = super.createCamelContext();
-
- zipkin = new ZipkinTracer();
- // we have one route as service
- zipkin.addClientServiceMapping("seda:timer", "timer");
- zipkin.addServerServiceMapping("seda:timer", "timer");
- setSpanReporter(zipkin);
-
- // attaching ourself to CamelContext
- zipkin.init(context);
-
- return context;
- }
-
- @Test
- public void testZipkinRoute() {
- NotifyBuilder notify = new NotifyBuilder(context).from("seda:timer").whenDone(1).create();
-
- template.sendBody("direct:start", "Hello Timer");
-
- assertTrue(notify.matches(30, TimeUnit.SECONDS));
- }
-
- @Override
- protected RoutesBuilder createRouteBuilder() {
- return new RouteBuilder() {
- @Override
- public void configure() {
- from("direct:start").to(ExchangePattern.InOut, "seda:timer");
-
- from("seda:timer").routeId("timer")
- .log("routing at ${routeId}")
- .delay(simple("${random(1000,2000)}"));
- }
- };
- }
-}
diff --git a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinTracerTest.java b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinTracerTest.java
deleted file mode 100644
index 47f88e71ce7..00000000000
--- a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinTracerTest.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * 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.zipkin;
-
-import brave.Span;
-import org.apache.camel.CamelContext;
-import org.apache.camel.Endpoint;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.assertj.core.api.Assertions;
-import org.junit.jupiter.api.Test;
-import zipkin2.reporter.Reporter;
-
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-public class ZipkinTracerTest extends CamelTestSupport {
-
- private ZipkinTracer zipkin;
-
- private Endpoint endpoint;
-
- protected void setSpanReporter(ZipkinTracer zipkin) {
- zipkin.setSpanReporter(Reporter.NOOP);
- }
-
- @Override
- protected CamelContext createCamelContext() throws Exception {
- CamelContext context = super.createCamelContext();
- zipkin = new ZipkinTracer();
- setSpanReporter(zipkin);
- // attaching ourself to CamelContext
- zipkin.init(context);
- return context;
-
- }
-
- @Test
- public void testJmsProducerEndpoint() {
- endpoint = mock(Endpoint.class);
- when(endpoint.getEndpointBaseUri()).thenReturn("jms:queue");
- Span.Kind spankind = zipkin.getProducerComponentSpanKind(endpoint);
- Assertions.assertThat(spankind).isEqualTo(Span.Kind.PRODUCER);
- }
-
- @Test
- public void testKafkaProducerEndpoint() {
- endpoint = mock(Endpoint.class);
- when(endpoint.getEndpointBaseUri()).thenReturn("kafka:topic");
- Span.Kind spankind = zipkin.getProducerComponentSpanKind(endpoint);
- Assertions.assertThat(spankind).isEqualTo(Span.Kind.PRODUCER);
- }
-
- @Test
- public void testSJMSProducerEndpoint() {
- endpoint = mock(Endpoint.class);
- when(endpoint.getEndpointBaseUri()).thenReturn("sjms:queue");
- Span.Kind spankind = zipkin.getProducerComponentSpanKind(endpoint);
- Assertions.assertThat(spankind).isEqualTo(Span.Kind.PRODUCER);
- }
-
- @Test
- public void testActiveMQProducerEndpoint() {
- endpoint = mock(Endpoint.class);
- when(endpoint.getEndpointBaseUri()).thenReturn("activemq:queue");
- Span.Kind spankind = zipkin.getProducerComponentSpanKind(endpoint);
- Assertions.assertThat(spankind).isEqualTo(Span.Kind.PRODUCER);
- }
-
- @Test
- public void testNonProducerEndpoint() {
- endpoint = mock(Endpoint.class);
- when(endpoint.getEndpointBaseUri()).thenReturn("http:www");
- Span.Kind spankind = zipkin.getProducerComponentSpanKind(endpoint);
- Assertions.assertThat(spankind).isEqualTo(Span.Kind.CLIENT);
- }
-
- @Test
- public void testNonProducerInvalidEndpoint() {
- endpoint = mock(Endpoint.class);
- when(endpoint.getEndpointBaseUri()).thenReturn("jms&queue");
- Span.Kind spankind = zipkin.getProducerComponentSpanKind(endpoint);
- Assertions.assertThat(spankind).isEqualTo(Span.Kind.CLIENT);
- }
-
- @Test
- public void testJmsConsumerEndpoint() {
- endpoint = mock(Endpoint.class);
- when(endpoint.getEndpointBaseUri()).thenReturn("jms:queue");
- Span.Kind spankind = zipkin.getConsumerComponentSpanKind(endpoint);
- Assertions.assertThat(spankind).isEqualTo(Span.Kind.CONSUMER);
- }
-
- @Test
- public void testKafkaConsumerEndpoint() {
- endpoint = mock(Endpoint.class);
- when(endpoint.getEndpointBaseUri()).thenReturn("kafka:topic");
- Span.Kind spankind = zipkin.getConsumerComponentSpanKind(endpoint);
- Assertions.assertThat(spankind).isEqualTo(Span.Kind.CONSUMER);
- }
-
- @Test
- public void testSJMSConsumerEndpoint() {
- endpoint = mock(Endpoint.class);
- when(endpoint.getEndpointBaseUri()).thenReturn("sjms:queue");
- Span.Kind spankind = zipkin.getConsumerComponentSpanKind(endpoint);
- Assertions.assertThat(spankind).isEqualTo(Span.Kind.CONSUMER);
- }
-
- @Test
- public void testActiveMQConsumerEndpoint() {
- endpoint = mock(Endpoint.class);
- when(endpoint.getEndpointBaseUri()).thenReturn("activemq:queue");
- Span.Kind spankind = zipkin.getConsumerComponentSpanKind(endpoint);
- Assertions.assertThat(spankind).isEqualTo(Span.Kind.CONSUMER);
- }
-
- @Test
- public void testNonConsumerEndpoint() {
- endpoint = mock(Endpoint.class);
- when(endpoint.getEndpointBaseUri()).thenReturn("rest:customer?");
- Span.Kind spankind = zipkin.getConsumerComponentSpanKind(endpoint);
- Assertions.assertThat(spankind).isEqualTo(Span.Kind.SERVER);
- }
-
- @Test
- public void testNonConsumerInvalidEndpoint() {
- endpoint = mock(Endpoint.class);
- when(endpoint.getEndpointBaseUri()).thenReturn("rest&customer?");
- Span.Kind spankind = zipkin.getConsumerComponentSpanKind(endpoint);
- Assertions.assertThat(spankind).isEqualTo(Span.Kind.SERVER);
- }
-
-}
diff --git a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinTwoRouteTest.java b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinTwoRouteTest.java
deleted file mode 100644
index 998b393420b..00000000000
--- a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/ZipkinTwoRouteTest.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * 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.zipkin;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.RoutesBuilder;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Test;
-import zipkin2.reporter.Reporter;
-
-public class ZipkinTwoRouteTest extends CamelTestSupport {
-
- private ZipkinTracer zipkin;
-
- protected void setSpanReporter(ZipkinTracer zipkin) {
- zipkin.setSpanReporter(Reporter.NOOP);
- }
-
- @Override
- protected CamelContext createCamelContext() throws Exception {
- CamelContext context = super.createCamelContext();
-
- zipkin = new ZipkinTracer();
- // we have 2 routes as services
- zipkin.addClientServiceMapping("seda:cat", "cat");
- zipkin.addServerServiceMapping("seda:cat", "cat");
- zipkin.addClientServiceMapping("seda:dog", "dog");
- zipkin.addServerServiceMapping("seda:dog", "dog");
- // capture message body as well
- zipkin.setIncludeMessageBody(true);
- setSpanReporter(zipkin);
-
- // attaching ourself to CamelContext
- zipkin.init(context);
-
- return context;
- }
-
- @Test
- public void testZipkinRoute() {
- template.requestBody("direct:start", "Camel say hello Cat");
- }
-
- @Override
- protected RoutesBuilder createRouteBuilder() {
- return new RouteBuilder() {
- @Override
- public void configure() {
- from("direct:start").to("seda:cat");
-
- from("seda:cat").routeId("cat")
- .log("routing at ${routeId}")
- .delay(simple("${random(1000,2000)}"))
- .setBody().constant("Cat says hello Dog")
- .to("seda:dog");
-
- from("seda:dog").routeId("dog")
- .log("routing at ${routeId}")
- .delay(simple("${random(0,500)}"))
- .setBody().constant("Dog say hello Cat and Camel");
- }
- };
- }
-}
diff --git a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/http/ZipkinABCRouteHttp.java b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/http/ZipkinABCRouteHttp.java
deleted file mode 100644
index 27c66f36ad7..00000000000
--- a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/http/ZipkinABCRouteHttp.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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.zipkin.http;
-
-import org.apache.camel.zipkin.ZipkinABCRouteTest;
-import org.apache.camel.zipkin.ZipkinTracer;
-import zipkin2.reporter.AsyncReporter;
-import zipkin2.reporter.urlconnection.URLConnectionSender;
-
-/**
- * Integration test requires running Zipkin running
- *
- * <p>
- * The easiest way to run is locally:
- *
- * <pre>
- * {@code
- * curl -sSL https://zipkin.io/quickstart.sh | bash -s
- * java -jar zipkin.jar
- * }
- * </pre>
- */
-public class ZipkinABCRouteHttp extends ZipkinABCRouteTest {
- @Override
- protected void setSpanReporter(ZipkinTracer zipkin) {
- zipkin.setSpanReporter(
- AsyncReporter.create(URLConnectionSender.create("http://locahost:9411/api/v2/spans")));
- }
-}
diff --git a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/http/ZipkinAutoConfigureHttp.java b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/http/ZipkinAutoConfigureHttp.java
deleted file mode 100644
index b6a9b53b7d2..00000000000
--- a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/http/ZipkinAutoConfigureHttp.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * 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.zipkin.http;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.RoutesBuilder;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.apache.camel.zipkin.ZipkinTracer;
-import org.junit.jupiter.api.Test;
-
-/**
- * Integration test requires running Zipkin running
- *
- * <p>
- * The easiest way to run is locally:
- *
- * <pre>
- * {@code
- * curl -sSL https://zipkin.io/quickstart.sh | bash -s
- * java -jar zipkin.jar
- * }
- * </pre>
- *
- * <p>
- * This test has to be run with environment variables set. For example:
- *
- * <pre>
- * {@code
- * ZIPKIN_COLLECTOR_HTTP_SERVICE_HOST=localhost
- * ZIPKIN_COLLECTOR_HTTP_SERVICE_PORT=9411
- * }
- * </pre>
- */
-public class ZipkinAutoConfigureHttp extends CamelTestSupport {
-
- private ZipkinTracer zipkin;
-
- @Override
- protected CamelContext createCamelContext() throws Exception {
- CamelContext context = super.createCamelContext();
-
- zipkin = new ZipkinTracer();
- // we have one route as service
- zipkin.addClientServiceMapping("seda:cat", "cat");
- zipkin.addServerServiceMapping("seda:cat", "cat");
- // should auto configure as we have not setup a span reporter
- // NOTE: this won't work unless you have an auto-configuration file in src/test/resources
-
- // attaching ourself to CamelContext
- zipkin.init(context);
-
- return context;
- }
-
- @Test
- public void testZipkinRoute() {
- template.requestBody("direct:start", "Hello Cat");
- }
-
- @Override
- protected RoutesBuilder createRouteBuilder() {
- return new RouteBuilder() {
- @Override
- public void configure() {
- from("direct:start").to("seda:cat");
-
- from("seda:cat").routeId("cat")
- .log("routing at ${routeId}")
- .delay(simple("${random(1000,2000)}"));
- }
- };
- }
-}
diff --git a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/http/ZipkinMulticastRouteHttp.java b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/http/ZipkinMulticastRouteHttp.java
deleted file mode 100644
index 47b78fd1f39..00000000000
--- a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/http/ZipkinMulticastRouteHttp.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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.zipkin.http;
-
-import org.apache.camel.zipkin.ZipkinMulticastRouteTest;
-import org.apache.camel.zipkin.ZipkinTracer;
-import zipkin2.reporter.AsyncReporter;
-import zipkin2.reporter.urlconnection.URLConnectionSender;
-
-/**
- * Integration test requires running Zipkin running
- *
- * <p>
- * The easiest way to run is locally:
- *
- * <pre>
- * {@code
- * curl -sSL https://zipkin.io/quickstart.sh | bash -s
- * java -jar zipkin.jar
- * }
- * </pre>
- */
-public class ZipkinMulticastRouteHttp extends ZipkinMulticastRouteTest {
- @Override
- protected void setSpanReporter(ZipkinTracer zipkin) {
- zipkin.setSpanReporter(
- AsyncReporter.create(URLConnectionSender.create("http://locahost:9411/api/v2/spans")));
- }
-}
diff --git a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/http/ZipkinOneRouteFallbackHttp.java b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/http/ZipkinOneRouteFallbackHttp.java
deleted file mode 100644
index 6ec0bd84c3f..00000000000
--- a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/http/ZipkinOneRouteFallbackHttp.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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.zipkin.http;
-
-import org.apache.camel.zipkin.ZipkinOneRouteFallbackTest;
-import org.apache.camel.zipkin.ZipkinTracer;
-import zipkin2.reporter.AsyncReporter;
-import zipkin2.reporter.urlconnection.URLConnectionSender;
-
-/**
- * Integration test requires running Zipkin running
- *
- * <p>
- * The easiest way to run is locally:
- *
- * <pre>
- * {@code
- * curl -sSL https://zipkin.io/quickstart.sh | bash -s
- * java -jar zipkin.jar
- * }
- * </pre>
- */
-public class ZipkinOneRouteFallbackHttp extends ZipkinOneRouteFallbackTest {
- @Override
- protected void setSpanReporter(ZipkinTracer zipkin) {
- zipkin.setSpanReporter(
- AsyncReporter.create(URLConnectionSender.create("http://locahost:9411/api/v2/spans")));
- }
-}
diff --git a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/http/ZipkinOneRouteHttp.java b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/http/ZipkinOneRouteHttp.java
deleted file mode 100644
index 0d12625626c..00000000000
--- a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/http/ZipkinOneRouteHttp.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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.zipkin.http;
-
-import org.apache.camel.zipkin.ZipkinOneRouteTest;
-import org.apache.camel.zipkin.ZipkinTracer;
-import zipkin2.reporter.AsyncReporter;
-import zipkin2.reporter.urlconnection.URLConnectionSender;
-
-/**
- * Integration test requires running Zipkin running
- *
- * <p>
- * The easiest way to run is locally:
- *
- * <pre>
- * {@code
- * curl -sSL https://zipkin.io/quickstart.sh | bash -s
- * java -jar zipkin.jar
- * }
- * </pre>
- */
-public class ZipkinOneRouteHttp extends ZipkinOneRouteTest {
- @Override
- protected void setSpanReporter(ZipkinTracer zipkin) {
- zipkin.setSpanReporter(
- AsyncReporter.create(URLConnectionSender.create("http://locahost:9411/api/v2/spans")));
- }
-}
diff --git a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/http/ZipkinSimpleRouteHttp.java b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/http/ZipkinSimpleRouteHttp.java
deleted file mode 100644
index 0a4e2564af3..00000000000
--- a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/http/ZipkinSimpleRouteHttp.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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.zipkin.http;
-
-import org.apache.camel.zipkin.ZipkinSimpleRouteTest;
-import org.apache.camel.zipkin.ZipkinTracer;
-import zipkin2.reporter.AsyncReporter;
-import zipkin2.reporter.urlconnection.URLConnectionSender;
-
-/**
- * Integration test requires running Zipkin running
- *
- * <p>
- * The easiest way to run is locally:
- *
- * <pre>
- * {@code
- * curl -sSL https://zipkin.io/quickstart.sh | bash -s
- * java -jar zipkin.jar
- * }
- * </pre>
- */
-public class ZipkinSimpleRouteHttp extends ZipkinSimpleRouteTest {
- @Override
- protected void setSpanReporter(ZipkinTracer zipkin) {
- zipkin.setSpanReporter(
- AsyncReporter.create(URLConnectionSender.create("http://locahost:9411/api/v2/spans")));
- }
-}
diff --git a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/http/ZipkinTimerRouteHttp.java b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/http/ZipkinTimerRouteHttp.java
deleted file mode 100644
index 149532a4683..00000000000
--- a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/http/ZipkinTimerRouteHttp.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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.zipkin.http;
-
-import org.apache.camel.zipkin.ZipkinTimerRouteTest;
-import org.apache.camel.zipkin.ZipkinTracer;
-import zipkin2.reporter.AsyncReporter;
-import zipkin2.reporter.urlconnection.URLConnectionSender;
-
-/**
- * Integration test requires running Zipkin running
- *
- * <p>
- * The easiest way to run is locally:
- *
- * <pre>
- * {@code
- * curl -sSL https://zipkin.io/quickstart.sh | bash -s
- * java -jar zipkin.jar
- * }
- * </pre>
- */
-public class ZipkinTimerRouteHttp extends ZipkinTimerRouteTest {
- @Override
- protected void setSpanReporter(ZipkinTracer zipkin) {
- zipkin.setSpanReporter(
- AsyncReporter.create(URLConnectionSender.create("http://locahost:9411/api/v2/spans")));
- }
-}
diff --git a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/http/ZipkinTwoRouteHttp.java b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/http/ZipkinTwoRouteHttp.java
deleted file mode 100644
index 7156d3f0678..00000000000
--- a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/http/ZipkinTwoRouteHttp.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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.zipkin.http;
-
-import org.apache.camel.zipkin.ZipkinTracer;
-import org.apache.camel.zipkin.ZipkinTwoRouteTest;
-import zipkin2.reporter.AsyncReporter;
-import zipkin2.reporter.urlconnection.URLConnectionSender;
-
-/**
- * Integration test requires running Zipkin running
- *
- * <p>
- * The easiest way to run is locally:
- *
- * <pre>
- * {@code
- * curl -sSL https://zipkin.io/quickstart.sh | bash -s
- * java -jar zipkin.jar
- * }
- * </pre>
- */
-public class ZipkinTwoRouteHttp extends ZipkinTwoRouteTest {
- @Override
- protected void setSpanReporter(ZipkinTracer zipkin) {
- zipkin.setSpanReporter(
- AsyncReporter.create(URLConnectionSender.create("http://locahost:9411/api/v2/spans")));
- }
-}
diff --git a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/scribe/ZipkinABCRouteScribeManualIT.java b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/scribe/ZipkinABCRouteScribeManualIT.java
deleted file mode 100644
index 5308aa526d0..00000000000
--- a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/scribe/ZipkinABCRouteScribeManualIT.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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.zipkin.scribe;
-
-import org.apache.camel.zipkin.ZipkinABCRouteTest;
-import org.apache.camel.zipkin.ZipkinTracer;
-import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
-import zipkin2.reporter.AsyncReporter;
-import zipkin2.reporter.libthrift.LibthriftSender;
-
-/**
- * Integration test requires running Zipkin/Scribe running
- *
- * <p>
- * The easiest way to run is locally:
- *
- * <pre>
- * {@code
- * curl -sSL https://zipkin.io/quickstart.sh | bash -s
- * curl -sSL https://zipkin.io/quickstart.sh | bash -s io.zipkin.java:zipkin-autoconfigure-collector-scribe:LATEST:module scribe.jar
- * SCRIBE_ENABLED=true \
- * java \
- * -Dloader.path='scribe.jar,scribe.jar!/lib' \
- * -Dspring.profiles.active=scribe \
- * -cp zipkin.jar \
- * org.springframework.boot.loader.PropertiesLauncher
- * }
- * </pre>
- *
- * <p>
- * Note: the scribe transport is deprecated. Most use out-of-box defaults, such as Http, RabbitMQ or Kafka.
- */
-@EnabledIfSystemProperty(named = "enable.zipkin.scribe.itests", matches = "true",
- disabledReason = "Requires Zipkin/scribe running")
-public class ZipkinABCRouteScribeManualIT extends ZipkinABCRouteTest {
- @Override
- protected void setSpanReporter(ZipkinTracer zipkin) {
- zipkin.setSpanReporter(AsyncReporter.create(LibthriftSender.create("127.0.0.1")));
- }
-}
diff --git a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/scribe/ZipkinAutoConfigureScribeManualIT.java b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/scribe/ZipkinAutoConfigureScribeManualIT.java
deleted file mode 100644
index 8ef03c0a3f5..00000000000
--- a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/scribe/ZipkinAutoConfigureScribeManualIT.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * 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.zipkin.scribe;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.RoutesBuilder;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.apache.camel.zipkin.ZipkinTracer;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
-
-/**
- * Integration test requires running Zipkin/Scribe running
- *
- * <p>
- * The easiest way to run is locally:
- *
- * <pre>
- * {@code
- * curl -sSL https://zipkin.io/quickstart.sh | bash -s
- * SCRIBE_ENABLED=true java -jar zipkin.jar
- * }
- * </pre>
- *
- * <p>
- * This test has to be run with environment variables set. For example:
- *
- * <pre>
- * {@code
- * ZIPKIN_COLLECTOR_THRIFT_SERVICE_HOST=localhost
- * ZIPKIN_COLLECTOR_THRIFT_SERVICE_PORT=9410
- * }
- * </pre>
- */
-@EnabledIfSystemProperty(named = "enable.zipkin.scribe.itests", matches = "true",
- disabledReason = "Requires Zipkin/scribe running")
-public class ZipkinAutoConfigureScribeManualIT extends CamelTestSupport {
-
- private ZipkinTracer zipkin;
-
- @Override
- protected CamelContext createCamelContext() throws Exception {
- CamelContext context = super.createCamelContext();
-
- zipkin = new ZipkinTracer();
- // we have one route as service
- zipkin.addClientServiceMapping("seda:cat", "cat");
- zipkin.addServerServiceMapping("seda:cat", "cat");
- // should auto configure as we have not setup a span reporter
-
- // attaching ourself to CamelContext
- zipkin.init(context);
-
- return context;
- }
-
- @Test
- public void testZipkinRoute() {
- template.requestBody("direct:start", "Hello Cat");
- }
-
- @Override
- protected RoutesBuilder createRouteBuilder() {
- return new RouteBuilder() {
- @Override
- public void configure() {
- from("direct:start").to("seda:cat");
-
- from("seda:cat").routeId("cat")
- .log("routing at ${routeId}")
- .delay(simple("${random(1000,2000)}"));
- }
- };
- }
-}
diff --git a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/scribe/ZipkinMulticastRouteScribeManualIT.java b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/scribe/ZipkinMulticastRouteScribeManualIT.java
deleted file mode 100644
index 7f01fe7b5b8..00000000000
--- a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/scribe/ZipkinMulticastRouteScribeManualIT.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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.zipkin.scribe;
-
-import org.apache.camel.zipkin.ZipkinMulticastRouteTest;
-import org.apache.camel.zipkin.ZipkinTracer;
-import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
-import zipkin2.reporter.AsyncReporter;
-import zipkin2.reporter.libthrift.LibthriftSender;
-
-/**
- * Integration test requires running Zipkin/Scribe running
- *
- * <p>
- * The easiest way to run is locally:
- *
- * <pre>
- * {@code
- * curl -sSL https://zipkin.io/quickstart.sh | bash -s
- * curl -sSL https://zipkin.io/quickstart.sh | bash -s io.zipkin.java:zipkin-autoconfigure-collector-scribe:LATEST:module scribe.jar
- * SCRIBE_ENABLED=true \
- * java \
- * -Dloader.path='scribe.jar,scribe.jar!/lib' \
- * -Dspring.profiles.active=scribe \
- * -cp zipkin.jar \
- * org.springframework.boot.loader.PropertiesLauncher
- * }
- * </pre>
- *
- * <p>
- * Note: the scribe transport is deprecated. Most use out-of-box defaults, such as Http, RabbitMQ or Kafka.
- */
-@EnabledIfSystemProperty(named = "enable.zipkin.scribe.itests", matches = "true",
- disabledReason = "Requires Zipkin/scribe running")
-public class ZipkinMulticastRouteScribeManualIT extends ZipkinMulticastRouteTest {
- @Override
- protected void setSpanReporter(ZipkinTracer zipkin) {
- zipkin.setSpanReporter(AsyncReporter.create(LibthriftSender.create("127.0.0.1")));
- }
-}
diff --git a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/scribe/ZipkinOneRouteFallbackScribeManualIT.java b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/scribe/ZipkinOneRouteFallbackScribeManualIT.java
deleted file mode 100644
index a0dc3f7d2fb..00000000000
--- a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/scribe/ZipkinOneRouteFallbackScribeManualIT.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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.zipkin.scribe;
-
-import org.apache.camel.zipkin.ZipkinOneRouteFallbackTest;
-import org.apache.camel.zipkin.ZipkinTracer;
-import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
-import zipkin2.reporter.AsyncReporter;
-import zipkin2.reporter.libthrift.LibthriftSender;
-
-/**
- * Integration test requires running Zipkin/Scribe running
- *
- * <p>
- * The easiest way to run is locally:
- *
- * <pre>
- * {@code
- * curl -sSL https://zipkin.io/quickstart.sh | bash -s
- * curl -sSL https://zipkin.io/quickstart.sh | bash -s io.zipkin.java:zipkin-autoconfigure-collector-scribe:LATEST:module scribe.jar
- * SCRIBE_ENABLED=true \
- * java \
- * -Dloader.path='scribe.jar,scribe.jar!/lib' \
- * -Dspring.profiles.active=scribe \
- * -cp zipkin.jar \
- * org.springframework.boot.loader.PropertiesLauncher
- * }
- * </pre>
- *
- * <p>
- * Note: the scribe transport is deprecated. Most use out-of-box defaults, such as Http, RabbitMQ or Kafka.
- */
-@EnabledIfSystemProperty(named = "enable.zipkin.scribe.itests", matches = "true",
- disabledReason = "Requires Zipkin/scribe running")
-public class ZipkinOneRouteFallbackScribeManualIT extends ZipkinOneRouteFallbackTest {
- @Override
- protected void setSpanReporter(ZipkinTracer zipkin) {
- zipkin.setSpanReporter(AsyncReporter.create(LibthriftSender.create("127.0.0.1")));
- }
-}
diff --git a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/scribe/ZipkinOneRouteScribeManualIT.java b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/scribe/ZipkinOneRouteScribeManualIT.java
deleted file mode 100644
index 1119c6f4746..00000000000
--- a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/scribe/ZipkinOneRouteScribeManualIT.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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.zipkin.scribe;
-
-import org.apache.camel.zipkin.ZipkinOneRouteTest;
-import org.apache.camel.zipkin.ZipkinTracer;
-import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
-import zipkin2.reporter.AsyncReporter;
-import zipkin2.reporter.libthrift.LibthriftSender;
-
-/**
- * Integration test requires running Zipkin/Scribe running
- *
- * <p>
- * The easiest way to run is locally:
- *
- * <pre>
- * {@code
- * curl -sSL https://zipkin.io/quickstart.sh | bash -s
- * curl -sSL https://zipkin.io/quickstart.sh | bash -s io.zipkin.java:zipkin-autoconfigure-collector-scribe:LATEST:module scribe.jar
- * SCRIBE_ENABLED=true \
- * java \
- * -Dloader.path='scribe.jar,scribe.jar!/lib' \
- * -Dspring.profiles.active=scribe \
- * -cp zipkin.jar \
- * org.springframework.boot.loader.PropertiesLauncher
- * }
- * </pre>
- *
- * <p>
- * Note: the scribe transport is deprecated. Most use out-of-box defaults, such as Http, RabbitMQ or Kafka.
- */
-@EnabledIfSystemProperty(named = "enable.zipkin.scribe.itests", matches = "true",
- disabledReason = "Requires Zipkin/scribe running")
-public class ZipkinOneRouteScribeManualIT extends ZipkinOneRouteTest {
- @Override
- protected void setSpanReporter(ZipkinTracer zipkin) {
- zipkin.setSpanReporter(AsyncReporter.create(LibthriftSender.create("127.0.0.1")));
- }
-}
diff --git a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/scribe/ZipkinSimpleRouteScribeManualIT.java b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/scribe/ZipkinSimpleRouteScribeManualIT.java
deleted file mode 100644
index d7b32382925..00000000000
--- a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/scribe/ZipkinSimpleRouteScribeManualIT.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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.zipkin.scribe;
-
-import org.apache.camel.zipkin.ZipkinSimpleRouteTest;
-import org.apache.camel.zipkin.ZipkinTracer;
-import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
-import zipkin2.reporter.AsyncReporter;
-import zipkin2.reporter.libthrift.LibthriftSender;
-
-/**
- * Integration test requires running Zipkin/Scribe running
- *
- * <p>
- * The easiest way to run is locally:
- *
- * <pre>
- * {@code
- * curl -sSL https://zipkin.io/quickstart.sh | bash -s
- * curl -sSL https://zipkin.io/quickstart.sh | bash -s io.zipkin.java:zipkin-autoconfigure-collector-scribe:LATEST:module scribe.jar
- * SCRIBE_ENABLED=true \
- * java \
- * -Dloader.path='scribe.jar,scribe.jar!/lib' \
- * -Dspring.profiles.active=scribe \
- * -cp zipkin.jar \
- * org.springframework.boot.loader.PropertiesLauncher
- * }
- * </pre>
- *
- * <p>
- * Note: the scribe transport is deprecated. Most use out-of-box defaults, such as Http, RabbitMQ or Kafka.
- */
-@EnabledIfSystemProperty(named = "enable.zipkin.scribe.itests", matches = "true",
- disabledReason = "Requires Zipkin/scribe running")
-public class ZipkinSimpleRouteScribeManualIT extends ZipkinSimpleRouteTest {
- @Override
- protected void setSpanReporter(ZipkinTracer zipkin) {
- zipkin.setSpanReporter(AsyncReporter.create(LibthriftSender.create("127.0.0.1")));
- }
-}
diff --git a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/scribe/ZipkinTimerRouteScribeManualIT.java b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/scribe/ZipkinTimerRouteScribeManualIT.java
deleted file mode 100644
index 62154c9a3ca..00000000000
--- a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/scribe/ZipkinTimerRouteScribeManualIT.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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.zipkin.scribe;
-
-import org.apache.camel.zipkin.ZipkinTimerRouteTest;
-import org.apache.camel.zipkin.ZipkinTracer;
-import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
-import zipkin2.reporter.AsyncReporter;
-import zipkin2.reporter.libthrift.LibthriftSender;
-
-/**
- * Integration test requires running Zipkin/Scribe running
- *
- * <p>
- * The easiest way to run is locally:
- *
- * <pre>
- * {@code
- * curl -sSL https://zipkin.io/quickstart.sh | bash -s
- * curl -sSL https://zipkin.io/quickstart.sh | bash -s io.zipkin.java:zipkin-autoconfigure-collector-scribe:LATEST:module scribe.jar
- * SCRIBE_ENABLED=true \
- * java \
- * -Dloader.path='scribe.jar,scribe.jar!/lib' \
- * -Dspring.profiles.active=scribe \
- * -cp zipkin.jar \
- * org.springframework.boot.loader.PropertiesLauncher
- * }
- * </pre>
- *
- * <p>
- * Note: the scribe transport is deprecated. Most use out-of-box defaults, such as Http, RabbitMQ or Kafka.
- */
-@EnabledIfSystemProperty(named = "enable.zipkin.scribe.itests", matches = "true",
- disabledReason = "Requires Zipkin/scribe running")
-public class ZipkinTimerRouteScribeManualIT extends ZipkinTimerRouteTest {
- @Override
- protected void setSpanReporter(ZipkinTracer zipkin) {
- zipkin.setSpanReporter(AsyncReporter.create(LibthriftSender.create("127.0.0.1")));
- }
-}
diff --git a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/scribe/ZipkinTwoRouteScribeManualIT.java b/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/scribe/ZipkinTwoRouteScribeManualIT.java
deleted file mode 100644
index 595d8235398..00000000000
--- a/components/camel-zipkin/src/test/java/org/apache/camel/zipkin/scribe/ZipkinTwoRouteScribeManualIT.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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.zipkin.scribe;
-
-import org.apache.camel.zipkin.ZipkinTracer;
-import org.apache.camel.zipkin.ZipkinTwoRouteTest;
-import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
-import zipkin2.reporter.AsyncReporter;
-import zipkin2.reporter.libthrift.LibthriftSender;
-
-/**
- * Integration test requires running Zipkin/Scribe running
- *
- * <p>
- * The easiest way to run is locally:
- *
- * <pre>
- * {@code
- * curl -sSL https://zipkin.io/quickstart.sh | bash -s
- * curl -sSL https://zipkin.io/quickstart.sh | bash -s io.zipkin.java:zipkin-autoconfigure-collector-scribe:LATEST:module scribe.jar
- * SCRIBE_ENABLED=true \
- * java \
- * -Dloader.path='scribe.jar,scribe.jar!/lib' \
- * -Dspring.profiles.active=scribe \
- * -cp zipkin.jar \
- * org.springframework.boot.loader.PropertiesLauncher
- * }
- * </pre>
- *
- * <p>
- * Note: the scribe transport is deprecated. Most use out-of-box defaults, such as Http, RabbitMQ or Kafka.
- */
-@EnabledIfSystemProperty(named = "enable.zipkin.scribe.itests", matches = "true",
- disabledReason = "Requires Zipkin/scribe running")
-public class ZipkinTwoRouteScribeManualIT extends ZipkinTwoRouteTest {
- @Override
- protected void setSpanReporter(ZipkinTracer zipkin) {
- zipkin.setSpanReporter(AsyncReporter.create(LibthriftSender.create("127.0.0.1")));
- }
-}
diff --git a/components/camel-zipkin/src/test/resources/log4j2.properties b/components/camel-zipkin/src/test/resources/log4j2.properties
deleted file mode 100644
index 0da40e46f49..00000000000
--- a/components/camel-zipkin/src/test/resources/log4j2.properties
+++ /dev/null
@@ -1,32 +0,0 @@
-## ---------------------------------------------------------------------------
-## 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.
-## ---------------------------------------------------------------------------
-
-appender.file.type = File
-appender.file.name = file
-appender.file.fileName = target/camel-zipkin-test.log
-appender.file.layout.type = PatternLayout
-appender.file.layout.pattern = %d{ABSOLUTE} %-5p [%t] %C{2} (%F:%L) [%X{traceId}/%X{spanId}] - %m%n
-appender.out.type = Console
-appender.out.name = out
-appender.out.layout.type = PatternLayout
-appender.out.layout.pattern = %d{ABSOLUTE} %-5p [%t] %C{2} (%F:%L) [%X{traceId}/%X{spanId}] - %m%n
-logger.zipkin.name = org.apache.camel.zipkin
-logger.zipkin.level = DEBUG
-rootLogger.level = INFO
-rootLogger.appenderRef.file.ref = file
-
-
diff --git a/components/camel-zipkin/src/test/resources/org/apache/camel/zipkin/SpringZipkinSimpleRouteTest.xml b/components/camel-zipkin/src/test/resources/org/apache/camel/zipkin/SpringZipkinSimpleRouteTest.xml
deleted file mode 100644
index 4f46fadb1c6..00000000000
--- a/components/camel-zipkin/src/test/resources/org/apache/camel/zipkin/SpringZipkinSimpleRouteTest.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?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
- ">
-
- <!-- to use a logger as the span reporter (for testing) -->
- <bean id="logSpanReporter" class="org.apache.camel.zipkin.LogSpanReporterTest"/>
-
- <!-- setup zipkin tracer -->
- <bean id="zipkinTracer" class="org.apache.camel.zipkin.ZipkinTracer">
- <property name="serviceName" value="dude"/>
- <property name="spanReporter" ref="logSpanReporter"/>
- </bean>
-
- <camelContext xmlns="http://camel.apache.org/schema/spring">
-
- <route id="start">
- <from uri="direct:start"/>
- <to uri="seda:dude"/>
- </route>
-
- <route id="dude">
- <from uri="seda:dude"/>
- <log message="Routing at ${routeId}"/>
- <delay>
- <simple>${random(1000,2000)}</simple>
- </delay>
- </route>
- </camelContext>
-
-</beans>
diff --git a/components/pom.xml b/components/pom.xml
index 3695662f74f..6a09201f4cc 100644
--- a/components/pom.xml
+++ b/components/pom.xml
@@ -339,7 +339,6 @@
<module>camel-zendesk</module>
<module>camel-zip-deflater</module>
<module>camel-zipfile</module>
- <module>camel-zipkin</module>
<module>camel-zookeeper-master</module>
<module>camel-zookeeper</module>
<!-- build rest-openapi/rest-swagger at end as it uses all the http based components -->
diff --git a/parent/pom.xml b/parent/pom.xml
index d1ac6ea6f0b..56526b303cd 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -2585,11 +2585,6 @@
<artifactId>camel-zipfile</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-zipkin</artifactId>
- <version>${project.version}</version>
- </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-zookeeper</artifactId>