You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by gn...@apache.org on 2018/10/12 11:26:11 UTC
[camel] 07/44: [CAMEL-12819] Remove deprecated Tracer
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch sandbox/camel-3.x
in repository https://gitbox.apache.org/repos/asf/camel.git
commit b57ae6bc08a24404b27c5bc750ebee1974b4236e
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Fri Sep 7 20:45:46 2018 +0200
[CAMEL-12819] Remove deprecated Tracer
---
.../main/java/org/apache/camel/CamelContext.java | 17 -
.../api/management/mbean/ManagedTracerMBean.java | 194 ----------
.../org/apache/camel/impl/DefaultCamelContext.java | 21 +-
.../org/apache/camel/impl/DefaultDebugger.java | 25 --
.../apache/camel/impl/DefaultTracedRouteNodes.java | 108 ------
.../org/apache/camel/impl/DefaultUnitOfWork.java | 15 -
.../apache/camel/impl/SynchronizationAdapter.java | 26 --
.../camel/impl/ThreadPoolProfileSupport.java | 33 --
.../impl/cloud/AggregatingServiceDiscovery.java | 40 --
.../cloud/AggregatingServiceDiscoveryFactory.java | 24 --
.../camel/impl/cloud/ChainedServiceFilter.java | 31 --
.../impl/cloud/ChainedServiceFilterFactory.java | 24 --
.../converter/PropertyEditorTypeConverter.java | 154 --------
.../DefaultManagementLifecycleStrategy.java | 14 -
.../management/ManagedManagementStrategy.java | 4 -
.../mbean/JMXNotificationTraceEventHandler.java | 115 ------
.../camel/management/mbean/ManagedTracer.java | 416 ---------------------
.../apache/camel/processor/MulticastProcessor.java | 23 --
.../processor/interceptor/BacklogDebugger.java | 1 -
.../processor/interceptor/DefaultChannel.java | 49 ---
.../interceptor/DefaultTraceEventHandler.java | 149 --------
.../interceptor/DefaultTraceEventMessage.java | 269 -------------
.../interceptor/DefaultTraceFormatter.java | 402 --------------------
.../DefaultTraceInterceptorFactory.java | 29 --
.../processor/interceptor/TraceEventHandler.java | 73 ----
.../processor/interceptor/TraceEventMessage.java | 98 -----
.../processor/interceptor/TraceFormatter.java | 37 --
.../processor/interceptor/TraceInterceptor.java | 390 -------------------
.../interceptor/TraceInterceptorFactory.java | 44 ---
.../apache/camel/processor/interceptor/Tracer.java | 374 ------------------
.../org/apache/camel/spi/TracedRouteNodes.java | 92 -----
.../main/java/org/apache/camel/spi/UnitOfWork.java | 8 -
.../camel/component/file/FileSplitInSplitTest.java | 4 -
.../impl/DefaultExecutorServiceStrategyTest.java | 25 +-
.../management/ManagedCamelContextTracerTest.java | 160 --------
.../management/ManagedRouteContextTracerTest.java | 100 -----
.../camel/management/ManagedTracerOptionsTest.java | 177 ---------
.../DefaultErrorHandlerOnExceptionTraceTest.java | 117 ------
.../processor/OnCompletionGlobalTraceTest.java | 138 -------
.../processor/RecipientListReturnValueTest.java | 3 -
.../TraceInterceptorWithOutBodyTraceTest.java | 52 ---
.../apache/camel/processor/TracePerRouteTest.java | 67 ----
.../camel/processor/TraceableUnitOfWorkTest.java | 109 ------
.../camel/processor/TracerConfigurationTest.java | 8 -
.../processor/async/AsyncTraceHandlerTest.java | 107 ------
.../intercept/InterceptSimpleRouteTraceTest.java | 85 -----
...aultTraceEventMessageCausedByExceptionTest.java | 73 ----
.../interceptor/DefaultTraceEventMessageTest.java | 156 --------
.../interceptor/DefaultTraceFormatterTest.java | 170 ---------
.../processor/interceptor/TraceFormatterTest.java | 122 ------
.../processor/interceptor/TraceHandlerTest.java | 62 ---
.../interceptor/TraceHandlerTestHandler.java | 113 ------
.../interceptor/TraceInitIdOnAllNodesTest.java | 99 -----
.../TraceInterceptorCustomJpaMessage.java | 191 ----------
.../TraceInterceptorCustomJpaMessageTest.java | 91 -----
.../TraceInterceptorDestinationTest.java | 163 --------
.../TraceInterceptorFactoryCreatesHandlerTest.java | 74 ----
.../TraceInterceptorSubclassFactory.java | 100 -----
.../interceptor/TraceInterceptorSubclassTest.java | 46 ---
.../processor/interceptor/TraceTestProcessor.java | 31 --
.../camel/processor/interceptor/TracerTest.java | 109 ------
.../interceptor/TracingRedeliveryIssueTest.java | 60 ---
.../processor/interceptor/TracingTestBase.java | 138 -------
.../aws/xray/CamelAwsXRayTestSupport.java | 6 -
.../csv/BindyMarshalOneToManyWithHeadersTest.java | 9 +-
.../bindy/csv/BindyPojoSimpleCsvMarshallTest.java | 9 +-
.../csv/BindySimpleCsvBooleanUnmarshallTest.java | 9 +-
...BindySimpleCsvMarshallPositionModifiedTest.java | 9 +-
.../bindy/csv/BindySimpleCsvMarshallTest.java | 9 +-
.../BindySimpleCsvUnmarshallBadIntegerTest.java | 10 -
...ndySimpleCsvUnmarshallPositionModifiedTest.java | 8 -
.../bindy/csv/BindySimpleCsvUnmarshallTest.java | 8 -
...eKeyValuePairWithoutSectionMarshallDslTest.java | 11 +-
.../simple/BindySimpleFixedLengthMarshallTest.java | 9 +-
.../BindySimpleFixedLengthObjectMarshallTest.java | 7 -
.../core/xml/AbstractCamelContextFactoryBean.java | 12 -
.../camel/component/cxf/context-camel-1145.xml | 62 ---
.../component/file/remote/PaddyRouteTest.java | 4 +-
.../interceptor/jpa/JpaTraceEventMessage.java | 220 -----------
.../interceptor/JpaTraceEventMessageTest.java | 121 ------
.../src/test/resources/META-INF/persistence.xml | 14 -
.../profiles/hibernate/META-INF/persistence.xml | 13 -
.../camel/spring/boot/CamelAutoConfiguration.java | 40 --
.../interceptor/TracerConfigurationTest.java | 45 ---
...ingDefaultErrorHandlerOnExceptionTraceTest.java | 35 --
.../SpringInterceptSimpleRouteTraceTest.java | 35 --
.../SpringOnCompletionGlobalTraceTest.java | 35 --
...SpringTraceInterceptorWithOutBodyTraceTest.java | 29 --
.../spring/processor/SpringTracePerRouteTest.java | 32 --
.../tracing/SpringTraceInitIdOnAllNodesTest.java | 33 --
.../spring/processor/tracing/TraceHandlerTest.java | 28 --
.../TraceInterceptorCustomJpaMessageTest.java | 53 ---
.../tracing/TraceInterceptorSubclassTest.java | 37 --
.../spring/processor/tracing/TracingTestBase.java | 74 ----
.../spring/interceptor/traceFormatterTest.xml | 43 ---
.../spring/interceptor/tracerConfigurationTest.xml | 45 ---
...ringDefaultErrorHandlerOnExceptionTraceTest.xml | 48 ---
.../SpringInterceptSimpleRouteTraceTest.xml | 44 ---
.../SpringOnCompletionGlobalTraceTest.xml | 45 ---
.../processor/traceInterceptorWithOutBodyTrace.xml | 51 ---
.../camel/spring/processor/traceperroute.xml | 47 ---
.../tracing/SpringTraceInitIdOnAllNodesTest.xml | 46 ---
.../processor/tracing/traceHandlerTestContext.xml | 47 ---
.../traceInterceptorCustomJpaMessageContext.xml | 46 ---
.../tracing/traceInterceptorSubclassContext.xml | 50 ---
examples/camel-example-tracer/README.md | 38 --
examples/camel-example-tracer/pom.xml | 124 ------
.../camel/example/tracer/FixedDerbyDialect.java | 32 --
.../java/org/apache/camel/example/tracer/Main.java | 32 --
.../camel/example/tracer/QuoteAggregator.java | 78 ----
.../apache/camel/example/tracer/QuoteService.java | 47 ---
.../src/main/resources/META-INF/LICENSE.txt | 203 ----------
.../src/main/resources/META-INF/NOTICE.txt | 11 -
.../src/main/resources/META-INF/persistence.xml | 41 --
.../resources/META-INF/spring/camel-context.xml | 120 ------
.../src/main/resources/features.xml | 46 ---
.../src/main/resources/log4j2.properties | 23 --
examples/pom.xml | 1 -
118 files changed, 24 insertions(+), 8559 deletions(-)
diff --git a/camel-core/src/main/java/org/apache/camel/CamelContext.java b/camel-core/src/main/java/org/apache/camel/CamelContext.java
index 2bc5726..6828bb6 100644
--- a/camel-core/src/main/java/org/apache/camel/CamelContext.java
+++ b/camel-core/src/main/java/org/apache/camel/CamelContext.java
@@ -1527,23 +1527,6 @@ public interface CamelContext extends SuspendableService, RuntimeConfiguration {
void setManagementStrategy(ManagementStrategy strategy);
/**
- * Gets the default tracer
- *
- * @return the default tracer
- */
- InterceptStrategy getDefaultTracer();
-
- /**
- * Sets a custom tracer to be used as the default tracer.
- * <p/>
- * <b>Note:</b> This must be set before any routes are created,
- * changing the default tracer for existing routes is not supported.
- *
- * @param tracer the custom tracer to use as default tracer
- */
- void setDefaultTracer(InterceptStrategy tracer);
-
- /**
* Gets the default backlog tracer
*
* @return the default backlog tracer
diff --git a/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedTracerMBean.java b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedTracerMBean.java
deleted file mode 100644
index 4486253..0000000
--- a/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedTracerMBean.java
+++ /dev/null
@@ -1,194 +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.api.management.mbean;
-
-import org.apache.camel.api.management.ManagedAttribute;
-
-public interface ManagedTracerMBean {
-
- @ManagedAttribute(description = "Camel ID")
- String getCamelId();
-
- @ManagedAttribute(description = "Camel ManagementName")
- String getCamelManagementName();
-
- @ManagedAttribute(description = "Tracer enabled")
- boolean getEnabled();
-
- @ManagedAttribute(description = "Tracer enabled")
- void setEnabled(boolean enabled);
-
- @ManagedAttribute(description = "Additional destination URI")
- String getDestinationUri();
-
- @ManagedAttribute(description = "Additional destination URI")
- void setDestinationUri(String uri);
-
- @ManagedAttribute(description = "Logging Name")
- String getLogName();
-
- @ManagedAttribute(description = "Using JPA")
- boolean getUseJpa();
-
- @ManagedAttribute(description = "Logging Name")
- void setLogName(String logName);
-
- @ManagedAttribute(description = "Logging Level")
- String getLogLevel();
-
- @ManagedAttribute(description = "Logging Level")
- void setLogLevel(String logLevel);
-
- @ManagedAttribute(description = "Log Stacktrace")
- boolean getLogStackTrace();
-
- @ManagedAttribute(description = "Log Stacktrace")
- void setLogStackTrace(boolean logStackTrace);
-
- @ManagedAttribute(description = "Trace Interceptors")
- boolean getTraceInterceptors();
-
- @ManagedAttribute(description = "Trace Interceptors")
- void setTraceInterceptors(boolean traceInterceptors);
-
- @ManagedAttribute(description = "Trace Exceptions")
- boolean getTraceExceptions();
-
- @ManagedAttribute(description = "Trace Exceptions")
- void setTraceExceptions(boolean traceExceptions);
-
- @ManagedAttribute(description = "Trace Out Exchanges")
- boolean getTraceOutExchanges();
-
- @ManagedAttribute(description = "Trace Out Exchanges")
- void setTraceOutExchanges(boolean traceOutExchanges);
-
- @ManagedAttribute(description = "Formatter show body")
- boolean getFormatterShowBody();
-
- @ManagedAttribute(description = "Formatter show body")
- void setFormatterShowBody(boolean showBody);
-
- @ManagedAttribute(description = "Formatter show body type")
- boolean getFormatterShowBodyType();
-
- @ManagedAttribute(description = "Formatter show body type")
- void setFormatterShowBodyType(boolean showBodyType);
-
- @ManagedAttribute(description = "Formatter show out body")
- boolean getFormatterShowOutBody();
-
- @ManagedAttribute(description = "Formatter show out body")
- void setFormatterShowOutBody(boolean showOutBody);
-
- @ManagedAttribute(description = "Formatter show out body type")
- boolean getFormatterShowOutBodyType();
-
- @ManagedAttribute(description = "Formatter show out body type")
- void setFormatterShowOutBodyType(boolean showOutBodyType);
-
- @ManagedAttribute(description = "Formatter show breadcrumb")
- boolean getFormatterShowBreadCrumb();
-
- @ManagedAttribute(description = "Formatter show breadcrumb")
- void setFormatterShowBreadCrumb(boolean showBreadCrumb);
-
- @ManagedAttribute(description = "Formatter show exchange ID")
- boolean getFormatterShowExchangeId();
-
- @ManagedAttribute(description = "Formatter show exchange ID")
- void setFormatterShowExchangeId(boolean showExchangeId);
-
- @ManagedAttribute(description = "Formatter show headers")
- boolean getFormatterShowHeaders();
-
- @ManagedAttribute(description = "Formatter show headers")
- void setFormatterShowHeaders(boolean showHeaders);
-
- @ManagedAttribute(description = "Formatter show out headers")
- boolean getFormatterShowOutHeaders();
-
- @ManagedAttribute(description = "Formatter show out headers")
- void setFormatterShowOutHeaders(boolean showOutHeaders);
-
- @ManagedAttribute(description = "Formatter show properties")
- boolean getFormatterShowProperties();
-
- @ManagedAttribute(description = "Formatter show properties")
- void setFormatterShowProperties(boolean showProperties);
-
- @ManagedAttribute(description = "Formatter show node")
- boolean getFormatterShowNode();
-
- @ManagedAttribute(description = "Formatter show node")
- void setFormatterShowNode(boolean showNode);
-
- @ManagedAttribute(description = "Formatter show exchange pattern")
- boolean getFormatterShowExchangePattern();
-
- @ManagedAttribute(description = "Formatter show exchange pattern")
- void setFormatterShowExchangePattern(boolean showExchangePattern);
-
- @ManagedAttribute(description = "Formatter show exception")
- boolean getFormatterShowException();
-
- @ManagedAttribute(description = "Formatter show exception")
- void setFormatterShowException(boolean showException);
-
- @ManagedAttribute(description = "Formatter show route ID")
- boolean getFormatterShowRouteId();
-
- @ManagedAttribute(description = "Formatter show route ID")
- void setFormatterShowRouteId(boolean showRouteId);
-
- @ManagedAttribute(description = "Formatter breadcrumb length")
- int getFormatterBreadCrumbLength();
-
- @ManagedAttribute(description = "Formatter breadcrumb length")
- void setFormatterBreadCrumbLength(int breadCrumbLength);
-
- @ManagedAttribute(description = "Formatter show short exchange ID")
- boolean getFormatterShowShortExchangeId();
-
- @ManagedAttribute(description = "Formatter show short exchange ID")
- void setFormatterShowShortExchangeId(boolean showShortExchangeId);
-
- @ManagedAttribute(description = "Formatter node length")
- int getFormatterNodeLength();
-
- @ManagedAttribute(description = "Formatter node length")
- void setFormatterNodeLength(int nodeLength);
-
- @ManagedAttribute(description = "Formatter max chars")
- int getFormatterMaxChars();
-
- @ManagedAttribute(description = "Formatter max chars")
- void setFormatterMaxChars(int maxChars);
-
- @ManagedAttribute(description = "Should trace events be sent as JMX notifications")
- boolean isJmxTraceNotifications();
-
- @ManagedAttribute(description = "Should trace events be sent as JMX notifications")
- void setJmxTraceNotifications(boolean jmxTraceNotifications);
-
- @ManagedAttribute(description = "Maximum size of a message body for trace notification")
- int getTraceBodySize();
-
- @ManagedAttribute(description = "Maximum size of a message body for trace notification")
- void setTraceBodySize(int traceBodySize);
-
-}
\ No newline at end of file
diff --git a/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java b/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
index 69670f0..39417ac 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
@@ -122,7 +122,6 @@ import org.apache.camel.processor.interceptor.Debug;
import org.apache.camel.processor.interceptor.Delayer;
import org.apache.camel.processor.interceptor.HandleFault;
import org.apache.camel.processor.interceptor.StreamCaching;
-import org.apache.camel.processor.interceptor.Tracer;
import org.apache.camel.runtimecatalog.DefaultRuntimeCamelCatalog;
import org.apache.camel.runtimecatalog.RuntimeCamelCatalog;
import org.apache.camel.spi.AsyncProcessorAwaitManager;
@@ -286,7 +285,6 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon
private NodeIdFactory nodeIdFactory = createNodeIdFactory();
private ProcessorFactory processorFactory = createProcessorFactory();
private MessageHistoryFactory messageHistoryFactory = createMessageHistoryFactory();
- private InterceptStrategy defaultTracer;
private InterceptStrategy defaultBacklogTracer;
private InterceptStrategy defaultBacklogDebugger;
private InflightRepository inflightRepository = createInflightRepository();
@@ -487,7 +485,7 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon
componentsInCreation.get().remove(name);
}
}
-
+
/**
* Function to initialize a component and auto start. Returns null if the autoCreateComponents is disabled
*/
@@ -2843,9 +2841,7 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon
// for backwards compatible or if user add them here instead of the setXXX methods
- if (interceptStrategy instanceof Tracer) {
- setTracing(true);
- } else if (interceptStrategy instanceof HandleFault) {
+ if (interceptStrategy instanceof HandleFault) {
setHandleFault(true);
} else if (interceptStrategy instanceof StreamCaching) {
setStreamCaching(true);
@@ -3495,7 +3491,7 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon
stopWatch.restart();
log.info("Apache Camel {} (CamelContext: {}) is shutting down", getVersion(), getName());
EventHelper.notifyCamelContextStopping(this);
-
+
// Stop the route controller
ServiceHelper.stopAndShutdownService(this.routeController);
@@ -4337,17 +4333,6 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon
this.managementStrategy = managementStrategy;
}
- public InterceptStrategy getDefaultTracer() {
- if (defaultTracer == null) {
- defaultTracer = new Tracer();
- }
- return defaultTracer;
- }
-
- public void setDefaultTracer(InterceptStrategy tracer) {
- this.defaultTracer = tracer;
- }
-
public InterceptStrategy getDefaultBacklogTracer() {
if (defaultBacklogTracer == null) {
defaultBacklogTracer = BacklogTracer.createTracer(this);
diff --git a/camel-core/src/main/java/org/apache/camel/impl/DefaultDebugger.java b/camel-core/src/main/java/org/apache/camel/impl/DefaultDebugger.java
index 5d8b6ad..1ef52b8 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/DefaultDebugger.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/DefaultDebugger.java
@@ -29,7 +29,6 @@ import java.util.concurrent.CopyOnWriteArrayList;
import org.apache.camel.CamelContext;
import org.apache.camel.CamelContextAware;
import org.apache.camel.Exchange;
-import org.apache.camel.LoggingLevel;
import org.apache.camel.MessageHistory;
import org.apache.camel.NamedNode;
import org.apache.camel.Processor;
@@ -37,7 +36,6 @@ import org.apache.camel.management.event.AbstractExchangeEvent;
import org.apache.camel.management.event.ExchangeCompletedEvent;
import org.apache.camel.management.event.ExchangeCreatedEvent;
import org.apache.camel.model.ProcessorDefinition;
-import org.apache.camel.processor.interceptor.Tracer;
import org.apache.camel.spi.Breakpoint;
import org.apache.camel.spi.Condition;
import org.apache.camel.spi.Debugger;
@@ -61,7 +59,6 @@ public class DefaultDebugger implements Debugger, CamelContextAware {
private final int maxConcurrentSingleSteps = 1;
private final Map<String, Breakpoint> singleSteps = new HashMap<>(maxConcurrentSingleSteps);
private CamelContext camelContext;
- private boolean useTracer = true;
/**
* Holder class for breakpoint and the associated conditions
@@ -105,15 +102,6 @@ public class DefaultDebugger implements Debugger, CamelContextAware {
this.camelContext = camelContext;
}
- public boolean isUseTracer() {
- return useTracer;
- }
-
- public void setUseTracer(boolean useTracer) {
- this.useTracer = useTracer;
- }
-
- @Override
public void addBreakpoint(Breakpoint breakpoint) {
breakpoints.add(new BreakpointConditions(breakpoint));
}
@@ -359,19 +347,6 @@ public class DefaultDebugger implements Debugger, CamelContextAware {
// register our event notifier
ServiceHelper.startService(debugEventNotifier);
camelContext.getManagementStrategy().addEventNotifier(debugEventNotifier);
-
- if (isUseTracer()) {
- Tracer tracer = Tracer.getTracer(camelContext);
- if (tracer == null) {
- // tracer is disabled so enable it silently so we can leverage it to trace the Exchanges for us
- tracer = Tracer.createTracer(camelContext);
- tracer.setLogLevel(LoggingLevel.OFF);
- camelContext.addService(tracer);
- camelContext.addInterceptStrategy(tracer);
- }
- // make sure tracer is enabled so the debugger can leverage the tracer for debugging purposes
- tracer.setEnabled(true);
- }
}
@Override
diff --git a/camel-core/src/main/java/org/apache/camel/impl/DefaultTracedRouteNodes.java b/camel-core/src/main/java/org/apache/camel/impl/DefaultTracedRouteNodes.java
deleted file mode 100644
index 6bd16d7..0000000
--- a/camel-core/src/main/java/org/apache/camel/impl/DefaultTracedRouteNodes.java
+++ /dev/null
@@ -1,108 +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.impl;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Stack;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import org.apache.camel.Exchange;
-import org.apache.camel.RouteNode;
-import org.apache.camel.model.ProcessorDefinition;
-import org.apache.camel.spi.TracedRouteNodes;
-
-/**
- * Default {@link org.apache.camel.spi.TracedRouteNodes}
- *
- * @deprecated use {@link Exchange#MESSAGE_HISTORY} instead.
- */
-@Deprecated
-public class DefaultTracedRouteNodes implements TracedRouteNodes {
- private final Stack<List<RouteNode>> routeNodes = new Stack<>();
- private final Map<ProcessorDefinition<?>, AtomicInteger> nodeCounter = new HashMap<>();
-
- public DefaultTracedRouteNodes() {
- // create an empty list to start with
- routeNodes.push(new ArrayList<RouteNode>());
- }
-
- public void addTraced(RouteNode entry) {
- List<RouteNode> list = routeNodes.isEmpty() ? null : routeNodes.peek();
- if (list == null) {
- list = new ArrayList<>();
- routeNodes.push(list);
- }
- list.add(entry);
- }
-
- public RouteNode getLastNode() {
- List<RouteNode> list = routeNodes.isEmpty() ? null : routeNodes.peek();
- if (list == null || list.isEmpty()) {
- return null;
- }
- return list.get(list.size() - 1);
- }
-
- public RouteNode getSecondLastNode() {
- List<RouteNode> list = routeNodes.isEmpty() ? null : routeNodes.peek();
- if (list == null || list.isEmpty() || list.size() == 1) {
- return null;
- }
- return list.get(list.size() - 2);
- }
-
- public List<RouteNode> getNodes() {
- List<RouteNode> answer = new ArrayList<>();
- for (List<RouteNode> list : routeNodes) {
- answer.addAll(list);
- }
- return Collections.unmodifiableList(answer);
- }
-
- public void popBlock() {
- if (!routeNodes.isEmpty()) {
- routeNodes.pop();
- }
- }
-
- public void pushBlock() {
- // push a new block and add the last node as starting point
- RouteNode last = getLastNode();
- routeNodes.push(new ArrayList<RouteNode>());
- if (last != null) {
- addTraced(last);
- }
- }
-
- public void clear() {
- routeNodes.clear();
- }
-
- public int getAndIncrementCounter(ProcessorDefinition<?> node) {
- AtomicInteger count = nodeCounter.get(node);
- if (count == null) {
- count = new AtomicInteger();
- nodeCounter.put(node, count);
- }
- return count.getAndIncrement();
- }
-
-}
diff --git a/camel-core/src/main/java/org/apache/camel/impl/DefaultUnitOfWork.java b/camel-core/src/main/java/org/apache/camel/impl/DefaultUnitOfWork.java
index 51af899..7d87c40 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/DefaultUnitOfWork.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/DefaultUnitOfWork.java
@@ -40,7 +40,6 @@ import org.apache.camel.spi.SubUnitOfWork;
import org.apache.camel.spi.SubUnitOfWorkCallback;
import org.apache.camel.spi.Synchronization;
import org.apache.camel.spi.SynchronizationVetoable;
-import org.apache.camel.spi.TracedRouteNodes;
import org.apache.camel.spi.UnitOfWork;
import org.apache.camel.util.EventHelper;
import org.apache.camel.util.UnitOfWorkHelper;
@@ -65,7 +64,6 @@ public class DefaultUnitOfWork implements UnitOfWork, Service {
private CamelContext context;
private List<Synchronization> synchronizations;
private Message originalInMessage;
- private TracedRouteNodes tracedRouteNodes;
private Set<Object> transactedBy;
private final Deque<RouteContext> routeContextStack = new ArrayDeque<>();
private Deque<DefaultSubUnitOfWork> subUnitOfWorks;
@@ -83,12 +81,6 @@ public class DefaultUnitOfWork implements UnitOfWork, Service {
context = exchange.getContext();
- // only use tracer if explicit enabled
- if (context.isTracing() != null && context.isTracing()) {
- // backwards compatible
- tracedRouteNodes = new DefaultTracedRouteNodes();
- }
-
if (context.isAllowUseOriginalMessage()) {
// special for JmsMessage as it can cause it to loose headers later.
if (exchange.getIn().getClass().getName().equals("org.apache.camel.component.jms.JmsMessage")) {
@@ -170,9 +162,6 @@ public class DefaultUnitOfWork implements UnitOfWork, Service {
if (synchronizations != null) {
synchronizations.clear();
}
- if (tracedRouteNodes != null) {
- tracedRouteNodes.clear();
- }
if (transactedBy != null) {
transactedBy.clear();
}
@@ -301,10 +290,6 @@ public class DefaultUnitOfWork implements UnitOfWork, Service {
return originalInMessage;
}
- public TracedRouteNodes getTracedRouteNodes() {
- return tracedRouteNodes;
- }
-
public boolean isTransacted() {
return transactedBy != null && !transactedBy.isEmpty();
}
diff --git a/camel-core/src/main/java/org/apache/camel/impl/SynchronizationAdapter.java b/camel-core/src/main/java/org/apache/camel/impl/SynchronizationAdapter.java
deleted file mode 100644
index 45d1ab3..0000000
--- a/camel-core/src/main/java/org/apache/camel/impl/SynchronizationAdapter.java
+++ /dev/null
@@ -1,26 +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.impl;
-
-/**
- * @deprecated use org.apache.camel.support.SynchronizationAdapter instead
- *
- */
-@Deprecated
-public class SynchronizationAdapter extends org.apache.camel.support.SynchronizationAdapter {
-
-}
diff --git a/camel-core/src/main/java/org/apache/camel/impl/ThreadPoolProfileSupport.java b/camel-core/src/main/java/org/apache/camel/impl/ThreadPoolProfileSupport.java
deleted file mode 100644
index d27ca7d..0000000
--- a/camel-core/src/main/java/org/apache/camel/impl/ThreadPoolProfileSupport.java
+++ /dev/null
@@ -1,33 +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.impl;
-
-import org.apache.camel.spi.ThreadPoolProfile;
-
-/**
- * Use {@link ThreadPoolProfile} instead
- *
- * @deprecated use {@link ThreadPoolProfile} instead, will be removed in a future Camel release
- */
-@Deprecated
-public class ThreadPoolProfileSupport extends ThreadPoolProfile {
- private static final long serialVersionUID = 1L;
-
- public ThreadPoolProfileSupport(String id) {
- super(id);
- }
-}
diff --git a/camel-core/src/main/java/org/apache/camel/impl/cloud/AggregatingServiceDiscovery.java b/camel-core/src/main/java/org/apache/camel/impl/cloud/AggregatingServiceDiscovery.java
deleted file mode 100644
index e29c954..0000000
--- a/camel-core/src/main/java/org/apache/camel/impl/cloud/AggregatingServiceDiscovery.java
+++ /dev/null
@@ -1,40 +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.impl.cloud;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.camel.cloud.ServiceDiscovery;
-
-/**
- * @deprecated use {@link CombinedServiceDiscovery}
- */
-@Deprecated
-public class AggregatingServiceDiscovery extends CombinedServiceDiscovery {
- public AggregatingServiceDiscovery(List<ServiceDiscovery> delegates) {
- super(delegates);
- }
-
- // **********************
- // Helpers
- // **********************
-
- public static AggregatingServiceDiscovery wrap(ServiceDiscovery... delegates) {
- return new AggregatingServiceDiscovery(Arrays.asList(delegates));
- }
-}
diff --git a/camel-core/src/main/java/org/apache/camel/impl/cloud/AggregatingServiceDiscoveryFactory.java b/camel-core/src/main/java/org/apache/camel/impl/cloud/AggregatingServiceDiscoveryFactory.java
deleted file mode 100644
index e36c8f1..0000000
--- a/camel-core/src/main/java/org/apache/camel/impl/cloud/AggregatingServiceDiscoveryFactory.java
+++ /dev/null
@@ -1,24 +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.impl.cloud;
-
-/**
- * @deprecated use {@link CombinedServiceDiscoveryFactory}
- */
-@Deprecated
-public class AggregatingServiceDiscoveryFactory extends CombinedServiceDiscoveryFactory {
-}
diff --git a/camel-core/src/main/java/org/apache/camel/impl/cloud/ChainedServiceFilter.java b/camel-core/src/main/java/org/apache/camel/impl/cloud/ChainedServiceFilter.java
deleted file mode 100644
index 50cb538..0000000
--- a/camel-core/src/main/java/org/apache/camel/impl/cloud/ChainedServiceFilter.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.impl.cloud;
-
-import java.util.List;
-
-import org.apache.camel.cloud.ServiceFilter;
-
-/**
- * @deprecated use {@link CombinedServiceFilter}
- */
-@Deprecated
-public class ChainedServiceFilter extends CombinedServiceFilter {
- public ChainedServiceFilter(List<ServiceFilter> delegates) {
- super(delegates);
- }
-}
diff --git a/camel-core/src/main/java/org/apache/camel/impl/cloud/ChainedServiceFilterFactory.java b/camel-core/src/main/java/org/apache/camel/impl/cloud/ChainedServiceFilterFactory.java
deleted file mode 100644
index 61ac21b..0000000
--- a/camel-core/src/main/java/org/apache/camel/impl/cloud/ChainedServiceFilterFactory.java
+++ /dev/null
@@ -1,24 +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.impl.cloud;
-
-/**
- * @deprecated use {@link CombinedServiceFilterFactory}
- */
-@Deprecated
-public class ChainedServiceFilterFactory extends CombinedServiceFilterFactory {
-}
diff --git a/camel-core/src/main/java/org/apache/camel/impl/converter/PropertyEditorTypeConverter.java b/camel-core/src/main/java/org/apache/camel/impl/converter/PropertyEditorTypeConverter.java
deleted file mode 100644
index 3803af6..0000000
--- a/camel-core/src/main/java/org/apache/camel/impl/converter/PropertyEditorTypeConverter.java
+++ /dev/null
@@ -1,154 +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.impl.converter;
-
-import java.beans.PropertyEditor;
-import java.beans.PropertyEditorManager;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.camel.Exchange;
-import org.apache.camel.TypeConverter;
-import org.apache.camel.util.LRUCacheFactory;
-import org.apache.camel.util.ObjectHelper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Uses the {@link java.beans.PropertyEditor} conversion system to convert Objects to
- * and from String values.
- *
- * @deprecated should be removed as it can cause side-effects when using 3rd party property editors
- *
- * @version
- */
-@Deprecated
-public class PropertyEditorTypeConverter implements TypeConverter {
-
- private static final Logger LOG = LoggerFactory.getLogger(PropertyEditorTypeConverter.class);
- // use a soft bound cache to avoid using too much memory in case a lot of different classes
- // is being converted to string
- @SuppressWarnings("unchecked")
- private final Map<Class<?>, Class<?>> misses = LRUCacheFactory.newLRUSoftCache(1000);
- // we don't anticipate so many property editors so we have unbounded map
- private final Map<Class<?>, PropertyEditor> cache = new HashMap<>();
-
- public void clear() {
- cache.clear();
- misses.clear();
- }
-
- @Override
- public boolean allowNull() {
- return false;
- }
-
- @Override
- public <T> T convertTo(Class<T> type, Object value) {
- // We can't convert null values since we can't figure out a property
- // editor for it.
- if (value == null) {
- return null;
- }
-
- if (value.getClass() == String.class) {
- // No conversion needed.
- if (type == String.class) {
- return ObjectHelper.cast(type, value);
- }
-
- Class<?> key = type;
- PropertyEditor editor = lookupEditor(key);
- if (editor != null) {
- // we are essentially not thread safe as we use 2 calls to convert
- editor.setAsText(value.toString());
- return ObjectHelper.cast(type, editor.getValue());
- }
- } else if (type == String.class) {
- Class<?> key = value.getClass();
- PropertyEditor editor = lookupEditor(key);
- if (editor != null) {
- // we are essentially not thread safe as we use 2 calls to convert
- editor.setValue(value);
- return ObjectHelper.cast(type, editor.getAsText());
- }
- }
-
- return null;
- }
-
- private PropertyEditor lookupEditor(Class<?> type) {
- // check misses first
- if (misses.containsKey(type)) {
- LOG.trace("No previously found property editor for type: {}", type);
- return null;
- }
-
- synchronized (cache) {
- // not a miss then try to lookup the editor
- PropertyEditor editor = cache.get(type);
- if (editor == null) {
- // findEditor is synchronized and very slow so we want to only lookup once for a given key
- // and then we use our own local cache for faster lookup
- editor = PropertyEditorManager.findEditor(type);
-
- // either we found an editor, or if not then register it as a miss
- if (editor != null) {
- LOG.trace("Found property editor for type: {} -> {}", type, editor);
- cache.put(type, editor);
- } else {
- LOG.trace("Cannot find property editor for type: {}", type);
- misses.put(type, type);
- }
- }
- return editor;
- }
- }
-
- @Override
- public <T> T convertTo(Class<T> type, Exchange exchange, Object value) {
- return convertTo(type, value);
- }
-
- @Override
- public <T> T mandatoryConvertTo(Class<T> type, Object value) {
- return convertTo(type, value);
- }
-
- @Override
- public <T> T mandatoryConvertTo(Class<T> type, Exchange exchange, Object value) {
- return convertTo(type, value);
- }
-
- @Override
- public <T> T tryConvertTo(Class<T> type, Exchange exchange, Object value) {
- try {
- return convertTo(type, exchange, value);
- } catch (Exception e) {
- return null;
- }
- }
-
- @Override
- public <T> T tryConvertTo(Class<T> type, Object value) {
- try {
- return convertTo(type, null, value);
- } catch (Exception e) {
- return null;
- }
- }
-}
diff --git a/camel-core/src/main/java/org/apache/camel/management/DefaultManagementLifecycleStrategy.java b/camel-core/src/main/java/org/apache/camel/management/DefaultManagementLifecycleStrategy.java
index c35a58a..bd6ce84 100644
--- a/camel-core/src/main/java/org/apache/camel/management/DefaultManagementLifecycleStrategy.java
+++ b/camel-core/src/main/java/org/apache/camel/management/DefaultManagementLifecycleStrategy.java
@@ -72,7 +72,6 @@ import org.apache.camel.management.mbean.ManagedService;
import org.apache.camel.management.mbean.ManagedStreamCachingStrategy;
import org.apache.camel.management.mbean.ManagedThrottlingExceptionRoutePolicy;
import org.apache.camel.management.mbean.ManagedThrottlingInflightRoutePolicy;
-import org.apache.camel.management.mbean.ManagedTracer;
import org.apache.camel.management.mbean.ManagedTransformerRegistry;
import org.apache.camel.management.mbean.ManagedTypeConverterRegistry;
import org.apache.camel.management.mbean.ManagedValidatorRegistry;
@@ -87,7 +86,6 @@ import org.apache.camel.model.RouteDefinition;
import org.apache.camel.processor.CamelInternalProcessor;
import org.apache.camel.processor.interceptor.BacklogDebugger;
import org.apache.camel.processor.interceptor.BacklogTracer;
-import org.apache.camel.processor.interceptor.Tracer;
import org.apache.camel.runtimecatalog.RuntimeCamelCatalog;
import org.apache.camel.spi.AsyncProcessorAwaitManager;
import org.apache.camel.spi.DataFormat;
@@ -135,7 +133,6 @@ public class DefaultManagementLifecycleStrategy extends ServiceSupport implement
private volatile ManagedCamelContext camelContextMBean;
private volatile boolean initialized;
private final Set<String> knowRouteIds = new HashSet<>();
- private final Map<Tracer, ManagedTracer> managedTracers = new HashMap<>();
private final Map<BacklogTracer, ManagedBacklogTracer> managedBacklogTracers = new HashMap<>();
private final Map<BacklogDebugger, ManagedBacklogDebugger> managedBacklogDebuggers = new HashMap<>();
private final Map<ThreadPoolExecutor, Object> managedThreadPools = new HashMap<>();
@@ -478,16 +475,6 @@ public class DefaultManagementLifecycleStrategy extends ServiceSupport implement
if (service instanceof ManagementAware) {
return ((ManagementAware<Service>) service).getManagedObject(service);
- } else if (service instanceof Tracer) {
- // special for tracer
- Tracer tracer = (Tracer) service;
- ManagedTracer mt = managedTracers.get(tracer);
- if (mt == null) {
- mt = new ManagedTracer(context, tracer);
- mt.init(getManagementStrategy());
- managedTracers.put(tracer, mt);
- }
- return mt;
} else if (service instanceof BacklogTracer) {
// special for backlog tracer
BacklogTracer backlogTracer = (BacklogTracer) service;
@@ -1000,7 +987,6 @@ public class DefaultManagementLifecycleStrategy extends ServiceSupport implement
knowRouteIds.clear();
preServices.clear();
wrappedProcessors.clear();
- managedTracers.clear();
managedBacklogTracers.clear();
managedBacklogDebuggers.clear();
managedThreadPools.clear();
diff --git a/camel-core/src/main/java/org/apache/camel/management/ManagedManagementStrategy.java b/camel-core/src/main/java/org/apache/camel/management/ManagedManagementStrategy.java
index 449102e..85e3120 100644
--- a/camel-core/src/main/java/org/apache/camel/management/ManagedManagementStrategy.java
+++ b/camel-core/src/main/java/org/apache/camel/management/ManagedManagementStrategy.java
@@ -37,7 +37,6 @@ import org.apache.camel.management.mbean.ManagedRoute;
import org.apache.camel.management.mbean.ManagedRouteController;
import org.apache.camel.management.mbean.ManagedService;
import org.apache.camel.management.mbean.ManagedThreadPool;
-import org.apache.camel.management.mbean.ManagedTracer;
import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.spi.ManagementAgent;
import org.slf4j.Logger;
@@ -126,9 +125,6 @@ public class ManagedManagementStrategy extends DefaultManagementStrategy {
} else if (managedObject instanceof ManagedProducer) {
ManagedProducer ms = (ManagedProducer) managedObject;
objectName = getManagementNamingStrategy().getObjectNameForProducer(ms.getContext(), ms.getProducer());
- } else if (managedObject instanceof ManagedTracer) {
- ManagedTracer mt = (ManagedTracer) managedObject;
- objectName = getManagementNamingStrategy().getObjectNameForTracer(mt.getContext(), mt.getTracer());
} else if (managedObject instanceof ManagedBacklogTracer) {
ManagedBacklogTracer mt = (ManagedBacklogTracer) managedObject;
objectName = getManagementNamingStrategy().getObjectNameForTracer(mt.getContext(), mt.getBacklogTracer());
diff --git a/camel-core/src/main/java/org/apache/camel/management/mbean/JMXNotificationTraceEventHandler.java b/camel-core/src/main/java/org/apache/camel/management/mbean/JMXNotificationTraceEventHandler.java
deleted file mode 100644
index 8f60c93..0000000
--- a/camel-core/src/main/java/org/apache/camel/management/mbean/JMXNotificationTraceEventHandler.java
+++ /dev/null
@@ -1,115 +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.management.mbean;
-
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicLong;
-
-import javax.management.Notification;
-
-import org.apache.camel.Exchange;
-import org.apache.camel.Message;
-import org.apache.camel.Processor;
-import org.apache.camel.Traceable;
-import org.apache.camel.api.management.NotificationSender;
-import org.apache.camel.api.management.NotificationSenderAware;
-import org.apache.camel.model.ProcessorDefinition;
-import org.apache.camel.processor.interceptor.TraceEventHandler;
-import org.apache.camel.processor.interceptor.TraceInterceptor;
-import org.apache.camel.processor.interceptor.Tracer;
-import org.apache.camel.util.MessageHelper;
-
-public final class JMXNotificationTraceEventHandler implements TraceEventHandler, NotificationSenderAware {
- private static final int MAX_MESSAGE_LENGTH = 60;
- private final AtomicLong num = new AtomicLong();
- private final Tracer tracer;
- private NotificationSender notificationSender;
-
- public JMXNotificationTraceEventHandler(Tracer tracer) {
- this.tracer = tracer;
- }
-
- public void traceExchangeOut(ProcessorDefinition<?> node, Processor target, TraceInterceptor traceInterceptor, Exchange exchange, Object traceState) throws Exception {
- // We do nothing here
- }
-
- public Object traceExchangeIn(ProcessorDefinition<?> node, Processor target, TraceInterceptor traceInterceptor, Exchange exchange) throws Exception {
- // Just trace the exchange as usual
- traceExchange(node, target, traceInterceptor, exchange);
- return null;
- }
-
- public void traceExchange(ProcessorDefinition<?> node, Processor target, TraceInterceptor traceInterceptor, Exchange exchange) throws Exception {
- if (notificationSender != null && tracer.isJmxTraceNotifications()) {
- String body = MessageHelper.extractBodyForLogging(exchange.getIn(), "", false, true, tracer.getTraceBodySize());
-
- if (body == null) {
- body = "";
- }
- String message = body.substring(0, Math.min(body.length(), MAX_MESSAGE_LENGTH));
- Map<String, Object> tm = createTraceMessage(node, exchange, body);
-
- Notification notification = new Notification("TraceNotification", exchange.toString(), num.getAndIncrement(), System.currentTimeMillis(), message);
- notification.setUserData(tm);
-
- notificationSender.sendNotification(notification);
- }
-
- }
-
- private Map<String, Object> createTraceMessage(ProcessorDefinition<?> node, Exchange exchange, String body) {
- Map<String, Object> mi = new HashMap<>();
- mi.put("ExchangeId", exchange.getExchangeId());
- mi.put("EndpointURI", getEndpointUri(node));
- mi.put("TimeStamp", new Date(System.currentTimeMillis()));
- mi.put("Body", body);
-
- Message message = exchange.getIn();
- Map<String, Object> sHeaders = message.getHeaders();
- Map<String, Object> sProperties = exchange.getProperties();
-
- Map<String, String> headers = new HashMap<>();
- for (String key : sHeaders.keySet()) {
- headers.put(key, message.getHeader(key, String.class));
- }
- mi.put("Headers", headers);
-
- Map<String, String> properties = new HashMap<>();
- for (String key : sProperties.keySet()) {
- properties.put(key, exchange.getProperty(key, String.class));
- }
- mi.put("Properties", properties);
- return mi;
- }
-
- private String getEndpointUri(ProcessorDefinition<?> node) {
- if (node instanceof Traceable) {
- Traceable tr = (Traceable)node;
- return tr.getTraceLabel();
- } else {
- return node.getLabel();
- }
- }
-
- @Override
- public void setNotificationSender(NotificationSender sender) {
- this.notificationSender = sender;
- }
-
-}
diff --git a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedTracer.java b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedTracer.java
deleted file mode 100644
index 5f3d0fa..0000000
--- a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedTracer.java
+++ /dev/null
@@ -1,416 +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.management.mbean;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.LoggingLevel;
-import org.apache.camel.api.management.ManagedNotification;
-import org.apache.camel.api.management.ManagedNotifications;
-import org.apache.camel.api.management.ManagedResource;
-import org.apache.camel.api.management.NotificationSender;
-import org.apache.camel.api.management.NotificationSenderAware;
-import org.apache.camel.api.management.mbean.ManagedTracerMBean;
-import org.apache.camel.processor.interceptor.Tracer;
-import org.apache.camel.spi.ManagementStrategy;
-import org.apache.camel.util.ObjectHelper;
-
-/**
- * @version
- */
-@ManagedResource(description = "Managed Tracer")
-@ManagedNotifications(@ManagedNotification(name = "javax.management.Notification",
- description = "Fine grained trace events",
- notificationTypes = {"TraceNotification"}))
-public class ManagedTracer implements NotificationSenderAware, ManagedTracerMBean {
- private final CamelContext camelContext;
- private final Tracer tracer;
- private JMXNotificationTraceEventHandler jmxTraceHandler;
-
- public ManagedTracer(CamelContext camelContext, Tracer tracer) {
- this.camelContext = camelContext;
- this.tracer = tracer;
- jmxTraceHandler = new JMXNotificationTraceEventHandler(tracer);
- tracer.addTraceHandler(jmxTraceHandler);
- }
-
- public void init(ManagementStrategy strategy) {
- // do nothing
- }
-
- public CamelContext getContext() {
- return camelContext;
- }
-
- public Tracer getTracer() {
- return tracer;
- }
-
- public String getCamelId() {
- return camelContext.getName();
- }
-
- public String getCamelManagementName() {
- return camelContext.getManagementName();
- }
-
- public boolean getEnabled() {
- return tracer.isEnabled();
- }
-
- public void setEnabled(boolean enabled) {
- tracer.setEnabled(enabled);
- }
-
- public String getDestinationUri() {
- return tracer.getDestinationUri();
- }
-
- public void setDestinationUri(String uri) {
- if (ObjectHelper.isEmpty(uri)) {
- tracer.setDestinationUri(null);
- } else {
- tracer.setDestinationUri(uri);
- }
- }
-
- public String getLogName() {
- return tracer.getLogName();
- }
-
- public boolean getUseJpa() {
- return tracer.isUseJpa();
- }
-
- public void setLogName(String logName) {
- tracer.setLogName(logName);
- }
-
- public String getLogLevel() {
- return tracer.getLogLevel().name();
- }
-
- public void setLogLevel(String logLevel) {
- tracer.setLogLevel(LoggingLevel.valueOf(logLevel));
- }
-
- public boolean getLogStackTrace() {
- return tracer.isLogStackTrace();
- }
-
- public void setLogStackTrace(boolean logStackTrace) {
- tracer.setLogStackTrace(logStackTrace);
- }
-
- public boolean getTraceInterceptors() {
- return tracer.isTraceInterceptors();
- }
-
- public void setTraceInterceptors(boolean traceInterceptors) {
- tracer.setTraceInterceptors(traceInterceptors);
- }
-
- public boolean getTraceExceptions() {
- return tracer.isTraceExceptions();
- }
-
- public void setTraceExceptions(boolean traceExceptions) {
- tracer.setTraceExceptions(traceExceptions);
- }
-
- public boolean getTraceOutExchanges() {
- return tracer.isTraceOutExchanges();
- }
-
- public void setTraceOutExchanges(boolean traceOutExchanges) {
- tracer.setTraceOutExchanges(traceOutExchanges);
- }
-
- public boolean getFormatterShowBody() {
- if (tracer.getDefaultTraceFormatter() == null) {
- return false;
- }
- return tracer.getDefaultTraceFormatter().isShowBody();
- }
-
- public void setFormatterShowBody(boolean showBody) {
- if (tracer.getDefaultTraceFormatter() == null) {
- return;
- }
- tracer.getDefaultTraceFormatter().setShowBody(showBody);
- }
-
- public boolean getFormatterShowBodyType() {
- if (tracer.getDefaultTraceFormatter() == null) {
- return false;
- }
- return tracer.getDefaultTraceFormatter().isShowBodyType();
- }
-
- public void setFormatterShowBodyType(boolean showBodyType) {
- if (tracer.getDefaultTraceFormatter() == null) {
- return;
- }
- tracer.getDefaultTraceFormatter().setShowBodyType(showBodyType);
- }
-
- public boolean getFormatterShowOutBody() {
- if (tracer.getDefaultTraceFormatter() == null) {
- return false;
- }
- return tracer.getDefaultTraceFormatter().isShowOutBody();
- }
-
- public void setFormatterShowOutBody(boolean showOutBody) {
- if (tracer.getDefaultTraceFormatter() == null) {
- return;
- }
- tracer.getDefaultTraceFormatter().setShowOutBody(showOutBody);
- }
-
- public boolean getFormatterShowOutBodyType() {
- if (tracer.getDefaultTraceFormatter() == null) {
- return false;
- }
- return tracer.getDefaultTraceFormatter().isShowOutBodyType();
- }
-
- public void setFormatterShowOutBodyType(boolean showOutBodyType) {
- if (tracer.getDefaultTraceFormatter() == null) {
- return;
- }
- tracer.getDefaultTraceFormatter().setShowOutBodyType(showOutBodyType);
- }
-
- public boolean getFormatterShowBreadCrumb() {
- if (tracer.getDefaultTraceFormatter() == null) {
- return false;
- }
- return tracer.getDefaultTraceFormatter().isShowBreadCrumb();
- }
-
- public void setFormatterShowBreadCrumb(boolean showBreadCrumb) {
- if (tracer.getDefaultTraceFormatter() == null) {
- return;
- }
- tracer.getDefaultTraceFormatter().setShowBreadCrumb(showBreadCrumb);
- }
-
- public boolean getFormatterShowExchangeId() {
- if (tracer.getDefaultTraceFormatter() == null) {
- return false;
- }
- return tracer.getDefaultTraceFormatter().isShowExchangeId();
- }
-
- public void setFormatterShowExchangeId(boolean showExchangeId) {
- if (tracer.getDefaultTraceFormatter() == null) {
- return;
- }
- tracer.getDefaultTraceFormatter().setShowExchangeId(showExchangeId);
- }
-
- public boolean getFormatterShowHeaders() {
- if (tracer.getDefaultTraceFormatter() == null) {
- return false;
- }
- return tracer.getDefaultTraceFormatter().isShowHeaders();
- }
-
- public void setFormatterShowHeaders(boolean showHeaders) {
- if (tracer.getDefaultTraceFormatter() == null) {
- return;
- }
- tracer.getDefaultTraceFormatter().setShowHeaders(showHeaders);
- }
-
- public boolean getFormatterShowOutHeaders() {
- if (tracer.getDefaultTraceFormatter() == null) {
- return false;
- }
- return tracer.getDefaultTraceFormatter().isShowOutHeaders();
- }
-
- public void setFormatterShowOutHeaders(boolean showOutHeaders) {
- if (tracer.getDefaultTraceFormatter() == null) {
- return;
- }
- tracer.getDefaultTraceFormatter().setShowOutHeaders(showOutHeaders);
- }
-
- public boolean getFormatterShowProperties() {
- if (tracer.getDefaultTraceFormatter() == null) {
- return false;
- }
- return tracer.getDefaultTraceFormatter().isShowProperties();
- }
-
- public void setFormatterShowProperties(boolean showProperties) {
- if (tracer.getDefaultTraceFormatter() == null) {
- return;
- }
- tracer.getDefaultTraceFormatter().setShowProperties(showProperties);
- }
-
- public boolean getFormatterMultiline() {
- if (tracer.getDefaultTraceFormatter() == null) {
- return false;
- }
- return tracer.getDefaultTraceFormatter().isMultiline();
- }
-
- public void setFormatterMultiline(boolean multiline) {
- if (tracer.getDefaultTraceFormatter() == null) {
- return;
- }
- tracer.getDefaultTraceFormatter().setMultiline(multiline);
- }
-
-
- public boolean getFormatterShowNode() {
- if (tracer.getDefaultTraceFormatter() == null) {
- return false;
- }
- return tracer.getDefaultTraceFormatter().isShowNode();
- }
-
- public void setFormatterShowNode(boolean showNode) {
- if (tracer.getDefaultTraceFormatter() == null) {
- return;
- }
- tracer.getDefaultTraceFormatter().setShowNode(showNode);
- }
-
- public boolean getFormatterShowExchangePattern() {
- if (tracer.getDefaultTraceFormatter() == null) {
- return false;
- }
- return tracer.getDefaultTraceFormatter().isShowExchangePattern();
- }
-
- public void setFormatterShowExchangePattern(boolean showExchangePattern) {
- if (tracer.getDefaultTraceFormatter() == null) {
- return;
- }
- tracer.getDefaultTraceFormatter().setShowExchangePattern(showExchangePattern);
- }
-
- public boolean getFormatterShowException() {
- if (tracer.getDefaultTraceFormatter() == null) {
- return false;
- }
- return tracer.getDefaultTraceFormatter().isShowException();
- }
-
- public void setFormatterShowException(boolean showException) {
- if (tracer.getDefaultTraceFormatter() == null) {
- return;
- }
- tracer.getDefaultTraceFormatter().setShowException(showException);
- }
-
- public boolean getFormatterShowRouteId() {
- if (tracer.getDefaultTraceFormatter() == null) {
- return false;
- }
- return tracer.getDefaultTraceFormatter().isShowRouteId();
- }
-
- public void setFormatterShowRouteId(boolean showRouteId) {
- if (tracer.getDefaultTraceFormatter() == null) {
- return;
- }
- tracer.getDefaultTraceFormatter().setShowRouteId(showRouteId);
- }
-
- public int getFormatterBreadCrumbLength() {
- if (tracer.getDefaultTraceFormatter() == null) {
- return 0;
- }
- return tracer.getDefaultTraceFormatter().getBreadCrumbLength();
- }
-
- public void setFormatterBreadCrumbLength(int breadCrumbLength) {
- if (tracer.getDefaultTraceFormatter() == null) {
- return;
- }
- tracer.getDefaultTraceFormatter().setBreadCrumbLength(breadCrumbLength);
- }
-
- public boolean getFormatterShowShortExchangeId() {
- if (tracer.getDefaultTraceFormatter() == null) {
- return false;
- }
- return tracer.getDefaultTraceFormatter().isShowShortExchangeId();
- }
-
- public void setFormatterShowShortExchangeId(boolean showShortExchangeId) {
- if (tracer.getDefaultTraceFormatter() == null) {
- return;
- }
- tracer.getDefaultTraceFormatter().setShowShortExchangeId(showShortExchangeId);
- }
-
- public int getFormatterNodeLength() {
- if (tracer.getDefaultTraceFormatter() == null) {
- return 0;
- }
- return tracer.getDefaultTraceFormatter().getNodeLength();
- }
-
- public void setFormatterNodeLength(int nodeLength) {
- if (tracer.getDefaultTraceFormatter() == null) {
- return;
- }
- tracer.getDefaultTraceFormatter().setNodeLength(nodeLength);
- }
-
- public int getFormatterMaxChars() {
- if (tracer.getDefaultTraceFormatter() == null) {
- return 0;
- }
- return tracer.getDefaultTraceFormatter().getMaxChars();
- }
-
- public void setFormatterMaxChars(int maxChars) {
- if (tracer.getDefaultTraceFormatter() == null) {
- return;
- }
- tracer.getDefaultTraceFormatter().setMaxChars(maxChars);
- }
-
- public boolean isJmxTraceNotifications() {
- return this.tracer.isJmxTraceNotifications();
- }
-
- public void setJmxTraceNotifications(boolean jmxTraceNotifications) {
- this.tracer.setJmxTraceNotifications(jmxTraceNotifications);
- }
-
- public int getTraceBodySize() {
- return this.tracer.getTraceBodySize();
- }
-
- public void setTraceBodySize(int traceBodySize) {
- this.tracer.setTraceBodySize(traceBodySize);
- }
-
- @Override
- public void setNotificationSender(NotificationSender sender) {
- jmxTraceHandler.setNotificationSender(sender);
- }
-
-}
diff --git a/camel-core/src/main/java/org/apache/camel/processor/MulticastProcessor.java b/camel-core/src/main/java/org/apache/camel/processor/MulticastProcessor.java
index 98f8abc..f78a49a 100644
--- a/camel-core/src/main/java/org/apache/camel/processor/MulticastProcessor.java
+++ b/camel-core/src/main/java/org/apache/camel/processor/MulticastProcessor.java
@@ -54,7 +54,6 @@ import org.apache.camel.processor.aggregate.DelegateAggregationStrategy;
import org.apache.camel.processor.aggregate.TimeoutAwareAggregationStrategy;
import org.apache.camel.spi.IdAware;
import org.apache.camel.spi.RouteContext;
-import org.apache.camel.spi.TracedRouteNodes;
import org.apache.camel.spi.UnitOfWork;
import org.apache.camel.support.ServiceSupport;
import org.apache.camel.util.AsyncProcessorConverterHelper;
@@ -690,14 +689,7 @@ public class MulticastProcessor extends ServiceSupport implements AsyncProcessor
Processor processor = pair.getProcessor();
final Producer producer = pair.getProducer();
- TracedRouteNodes traced = exchange.getUnitOfWork() != null ? exchange.getUnitOfWork().getTracedRouteNodes() : null;
-
try {
- // prepare tracing starting from a new block
- if (traced != null) {
- traced.pushBlock();
- }
-
StopWatch sw = null;
if (producer != null) {
boolean sending = EventHelper.notifyExchangeSending(exchange.getContext(), exchange, producer.getEndpoint());
@@ -823,10 +815,6 @@ public class MulticastProcessor extends ServiceSupport implements AsyncProcessor
}
});
} finally {
- // pop the block so by next round we have the same staring point and thus the tracing looks accurate
- if (traced != null) {
- traced.popBlock();
- }
}
return sync;
@@ -837,16 +825,9 @@ public class MulticastProcessor extends ServiceSupport implements AsyncProcessor
Processor processor = pair.getProcessor();
Producer producer = pair.getProducer();
- TracedRouteNodes traced = exchange.getUnitOfWork() != null ? exchange.getUnitOfWork().getTracedRouteNodes() : null;
-
// compute time taken if sending to another endpoint
StopWatch watch = null;
try {
- // prepare tracing starting from a new block
- if (traced != null) {
- traced.pushBlock();
- }
-
if (producer != null) {
boolean sending = EventHelper.notifyExchangeSending(exchange.getContext(), exchange, producer.getEndpoint());
if (sending) {
@@ -860,10 +841,6 @@ public class MulticastProcessor extends ServiceSupport implements AsyncProcessor
AsyncProcessorHelper.process(async, exchange);
} finally {
pair.done();
- // pop the block so by next round we have the same staring point and thus the tracing looks accurate
- if (traced != null) {
- traced.popBlock();
- }
if (producer != null && watch != null) {
Endpoint endpoint = producer.getEndpoint();
long timeTaken = watch.taken();
diff --git a/camel-core/src/main/java/org/apache/camel/processor/interceptor/BacklogDebugger.java b/camel-core/src/main/java/org/apache/camel/processor/interceptor/BacklogDebugger.java
index ae92ff8..7cafc39 100644
--- a/camel-core/src/main/java/org/apache/camel/processor/interceptor/BacklogDebugger.java
+++ b/camel-core/src/main/java/org/apache/camel/processor/interceptor/BacklogDebugger.java
@@ -111,7 +111,6 @@ public class BacklogDebugger extends ServiceSupport implements InterceptStrategy
public BacklogDebugger(CamelContext camelContext) {
this.camelContext = camelContext;
DefaultDebugger debugger = new DefaultDebugger(camelContext);
- debugger.setUseTracer(false);
this.debugger = debugger;
}
diff --git a/camel-core/src/main/java/org/apache/camel/processor/interceptor/DefaultChannel.java b/camel-core/src/main/java/org/apache/camel/processor/interceptor/DefaultChannel.java
index 64a1f56..be36241 100644
--- a/camel-core/src/main/java/org/apache/camel/processor/interceptor/DefaultChannel.java
+++ b/camel-core/src/main/java/org/apache/camel/processor/interceptor/DefaultChannel.java
@@ -253,18 +253,6 @@ public class DefaultChannel extends CamelInternalProcessor implements ModelChann
addAdvice(new MessageHistoryAdvice(factory, targetOutputDef));
}
- // the regular tracer is not a task on internalProcessor as this is not really needed
- // end users have to explicit enable the tracer to use it, and then its okay if we wrap
- // the processors (but by default tracer is disabled, and therefore we do not wrap processors)
- tracer = getOrCreateTracer();
- if (tracer != null) {
- camelContext.addService(tracer);
- TraceInterceptor trace = (TraceInterceptor) tracer.wrapProcessorInInterceptors(routeContext.getCamelContext(), targetOutputDef, target, null);
- // trace interceptor need to have a reference to route context so we at runtime can enable/disable tracing on-the-fly
- trace.setRouteContext(routeContext);
- target = trace;
- }
-
// sort interceptors according to ordered
interceptors.sort(OrderedComparator.get());
// then reverse list so the first will be wrapped last, as it would then be first being invoked
@@ -272,10 +260,6 @@ public class DefaultChannel extends CamelInternalProcessor implements ModelChann
// wrap the output with the configured interceptors
for (InterceptStrategy strategy : interceptors) {
next = target == nextProcessor ? null : nextProcessor;
- // skip tracer as we did the specially beforehand and it could potentially be added as an interceptor strategy
- if (strategy instanceof Tracer) {
- continue;
- }
// skip stream caching as it must be wrapped as outer most, which we do later
if (strategy instanceof StreamCaching) {
continue;
@@ -344,39 +328,6 @@ public class DefaultChannel extends CamelInternalProcessor implements ModelChann
}
}
- private InterceptStrategy getOrCreateTracer() {
- // only use tracer if explicit enabled
- if (camelContext.isTracing() != null && !camelContext.isTracing()) {
- return null;
- }
-
- InterceptStrategy tracer = Tracer.getTracer(camelContext);
- if (tracer == null) {
- if (camelContext.getRegistry() != null) {
- // lookup in registry
- Map<String, Tracer> map = camelContext.getRegistry().findByTypeWithName(Tracer.class);
- if (map.size() == 1) {
- tracer = map.values().iterator().next();
- }
- }
- if (tracer == null) {
- // fallback to use the default tracer
- tracer = camelContext.getDefaultTracer();
-
- // configure and use any trace formatter if any exists
- Map<String, TraceFormatter> formatters = camelContext.getRegistry().findByTypeWithName(TraceFormatter.class);
- if (formatters.size() == 1) {
- TraceFormatter formatter = formatters.values().iterator().next();
- if (tracer instanceof Tracer) {
- ((Tracer) tracer).setFormatter(formatter);
- }
- }
- }
- }
-
- return tracer;
- }
-
private InterceptStrategy getOrCreateBacklogTracer() {
InterceptStrategy tracer = BacklogTracer.getBacklogTracer(camelContext);
if (tracer == null) {
diff --git a/camel-core/src/main/java/org/apache/camel/processor/interceptor/DefaultTraceEventHandler.java b/camel-core/src/main/java/org/apache/camel/processor/interceptor/DefaultTraceEventHandler.java
deleted file mode 100644
index f51a4ed..0000000
--- a/camel-core/src/main/java/org/apache/camel/processor/interceptor/DefaultTraceEventHandler.java
+++ /dev/null
@@ -1,149 +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.processor.interceptor;
-
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.camel.Endpoint;
-import org.apache.camel.Exchange;
-import org.apache.camel.Processor;
-import org.apache.camel.Producer;
-import org.apache.camel.Service;
-import org.apache.camel.impl.DefaultExchange;
-import org.apache.camel.model.ProcessorDefinition;
-import org.apache.camel.util.IntrospectionSupport;
-import org.apache.camel.util.ObjectHelper;
-import org.apache.camel.util.ServiceHelper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@Deprecated
-public class DefaultTraceEventHandler implements TraceEventHandler, Service {
- private static final Logger LOG = LoggerFactory.getLogger(DefaultTraceEventHandler.class);
-
- private Producer traceEventProducer;
- private Class<?> jpaTraceEventMessageClass;
- private String jpaTraceEventMessageClassName;
-
- private final Tracer tracer;
-
- public DefaultTraceEventHandler(Tracer tracer) {
- this.tracer = tracer;
- }
-
- private synchronized void loadJpaTraceEventMessageClass(Exchange exchange) {
- if (jpaTraceEventMessageClass == null) {
- jpaTraceEventMessageClassName = tracer.getJpaTraceEventMessageClassName();
- }
- if (jpaTraceEventMessageClass == null) {
- jpaTraceEventMessageClass = exchange.getContext().getClassResolver().resolveClass(jpaTraceEventMessageClassName);
- if (jpaTraceEventMessageClass == null) {
- throw new IllegalArgumentException("Cannot find class: " + jpaTraceEventMessageClassName
- + ". Make sure camel-jpa.jar is in the classpath.");
- }
- }
- }
-
- private synchronized Producer getTraceEventProducer(Exchange exchange) throws Exception {
- if (traceEventProducer == null) {
- // create producer when we have access the camel context (we dont in doStart)
- Endpoint endpoint = tracer.getDestination() != null ? tracer.getDestination() : exchange.getContext().getEndpoint(tracer.getDestinationUri());
- traceEventProducer = endpoint.createProducer();
- ServiceHelper.startService(traceEventProducer);
- }
- return traceEventProducer;
- }
-
- @Override
- public void traceExchange(ProcessorDefinition<?> node, Processor target, TraceInterceptor traceInterceptor, Exchange exchange) throws Exception {
- if (tracer.getDestination() != null || tracer.getDestinationUri() != null) {
-
- // create event exchange and add event information
- Date timestamp = new Date();
- Exchange event = new DefaultExchange(exchange);
- event.setProperty(Exchange.TRACE_EVENT_NODE_ID, node.getId());
- event.setProperty(Exchange.TRACE_EVENT_TIMESTAMP, timestamp);
- // keep a reference to the original exchange in case its needed
- event.setProperty(Exchange.TRACE_EVENT_EXCHANGE, exchange);
-
- // create event message to sent as in body containing event information such as
- // from node, to node, etc.
- TraceEventMessage msg = new DefaultTraceEventMessage(timestamp, node, exchange);
-
- // should we use ordinary or jpa objects
- if (tracer.isUseJpa()) {
- if (LOG.isTraceEnabled()) {
- LOG.trace("Using class: {} for tracing event messages", this.jpaTraceEventMessageClassName);
- }
-
- // load the jpa event message class
- loadJpaTraceEventMessageClass(exchange);
- // create a new instance of the event message class
- Object jpa = ObjectHelper.newInstance(jpaTraceEventMessageClass);
-
- // copy options from event to jpa
- Map<String, Object> options = new HashMap<>();
- IntrospectionSupport.getProperties(msg, options, null);
- IntrospectionSupport.setProperties(exchange.getContext().getTypeConverter(), jpa, options);
- // and set the timestamp as its not a String type
- IntrospectionSupport.setProperty(exchange.getContext().getTypeConverter(), jpa, "timestamp", msg.getTimestamp());
-
- event.getIn().setBody(jpa);
- } else {
- event.getIn().setBody(msg);
- }
-
- // marker property to indicate its a tracing event being routed in case
- // new Exchange instances is created during trace routing so we can check
- // for this marker when interceptor also kick in during routing of trace events
- event.setProperty(Exchange.TRACE_EVENT, Boolean.TRUE);
- try {
- // process the trace route
- getTraceEventProducer(exchange).process(event);
- } catch (Exception e) {
- // log and ignore this as the original Exchange should be allowed to continue
- LOG.error("Error processing trace event (original Exchange will continue): {}", event, e);
- }
- }
- }
-
- @Override
- public Object traceExchangeIn(ProcessorDefinition<?> node, Processor target, TraceInterceptor traceInterceptor, Exchange exchange) throws Exception {
- traceExchange(node, target, traceInterceptor, exchange);
- return null;
- }
-
- @Override
- public void traceExchangeOut(ProcessorDefinition<?> node, Processor target, TraceInterceptor traceInterceptor, Exchange exchange, Object traceState) throws Exception {
- traceExchange(node, target, traceInterceptor, exchange);
- }
-
- @Override
- public void start() throws Exception {
- traceEventProducer = null;
- }
-
- @Override
- public void stop() throws Exception {
- if (traceEventProducer != null) {
- ServiceHelper.stopService(traceEventProducer);
- }
- }
-
-}
diff --git a/camel-core/src/main/java/org/apache/camel/processor/interceptor/DefaultTraceEventMessage.java b/camel-core/src/main/java/org/apache/camel/processor/interceptor/DefaultTraceEventMessage.java
deleted file mode 100644
index 94569cb..0000000
--- a/camel-core/src/main/java/org/apache/camel/processor/interceptor/DefaultTraceEventMessage.java
+++ /dev/null
@@ -1,269 +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.processor.interceptor;
-
-import java.io.Serializable;
-import java.util.Date;
-
-import org.apache.camel.Exchange;
-import org.apache.camel.Message;
-import org.apache.camel.RouteNode;
-import org.apache.camel.model.ProcessorDefinition;
-import org.apache.camel.spi.TracedRouteNodes;
-import org.apache.camel.util.MessageHelper;
-
-/**
- * Default {@link TraceEventMessage}.
- */
-@Deprecated
-public final class DefaultTraceEventMessage implements Serializable, TraceEventMessage {
- private static final long serialVersionUID = -4549012920528941203L;
-
- private Date timestamp;
- private String fromEndpointUri;
- private String previousNode;
- private String toNode;
- private String exchangeId;
- private String shortExchangeId;
- private String exchangePattern;
- private String properties;
- private String headers;
- private String body;
- private String bodyType;
- private String outHeaders;
- private String outBody;
- private String outBodyType;
- private String causedByException;
- private String routeId;
- private final transient Exchange tracedExchange;
-
- /**
- * Creates a {@link DefaultTraceEventMessage} based on the given node it was traced while processing
- * the current {@link Exchange}
- *
- * @param toNode the node where this trace is intercepted
- * @param exchange the current {@link Exchange}
- */
- public DefaultTraceEventMessage(final Date timestamp, final ProcessorDefinition<?> toNode, final Exchange exchange) {
- this.tracedExchange = exchange;
- Message in = exchange.getIn();
-
- // need to use defensive copies to avoid Exchange altering after the point of interception
- this.timestamp = timestamp;
- this.fromEndpointUri = exchange.getFromEndpoint() != null ? exchange.getFromEndpoint().getEndpointUri() : null;
- this.previousNode = extractFromNode(exchange);
- this.toNode = extractToNode(exchange);
- this.exchangeId = exchange.getExchangeId();
- this.routeId = exchange.getFromRouteId();
- this.shortExchangeId = extractShortExchangeId(exchange);
- this.exchangePattern = exchange.getPattern().toString();
- this.properties = exchange.getProperties().isEmpty() ? null : exchange.getProperties().toString();
- this.headers = in.getHeaders().isEmpty() ? null : in.getHeaders().toString();
- // We should not turn the message body into String
- this.body = MessageHelper.extractBodyForLogging(in, "");
- this.bodyType = MessageHelper.getBodyTypeName(in);
- if (exchange.hasOut()) {
- Message out = exchange.getOut();
- this.outHeaders = out.getHeaders().isEmpty() ? null : out.getHeaders().toString();
- this.outBody = MessageHelper.extractBodyAsString(out);
- this.outBodyType = MessageHelper.getBodyTypeName(out);
- }
- this.causedByException = extractCausedByException(exchange);
- }
-
- // Implementation
- //---------------------------------------------------------------
-
- private static String extractCausedByException(Exchange exchange) {
- Throwable cause = exchange.getException();
- if (cause == null) {
- cause = exchange.getProperty(Exchange.EXCEPTION_CAUGHT, Throwable.class);
- }
-
- if (cause != null) {
- return cause.toString();
- } else {
- return null;
- }
- }
-
- private static String extractShortExchangeId(Exchange exchange) {
- return exchange.getExchangeId().substring(exchange.getExchangeId().indexOf("/") + 1);
- }
-
- private static String extractFromNode(Exchange exchange) {
- if (exchange.getUnitOfWork() != null) {
- TracedRouteNodes traced = exchange.getUnitOfWork().getTracedRouteNodes();
- if (traced != null) {
- RouteNode last = traced.getSecondLastNode();
- return last != null ? last.getLabel(exchange) : null;
- }
- }
- return null;
- }
-
- private static String extractToNode(Exchange exchange) {
- if (exchange.getUnitOfWork() != null) {
- TracedRouteNodes traced = exchange.getUnitOfWork().getTracedRouteNodes();
- if (traced != null) {
- RouteNode last = traced.getLastNode();
- return last != null ? last.getLabel(exchange) : null;
- }
- }
- return null;
- }
-
- // Properties
- //---------------------------------------------------------------
-
- public Date getTimestamp() {
- return timestamp;
- }
-
- public String getFromEndpointUri() {
- return fromEndpointUri;
- }
-
- public String getPreviousNode() {
- return previousNode;
- }
-
- public String getToNode() {
- return toNode;
- }
-
- public String getExchangeId() {
- return exchangeId;
- }
-
- public String getRouteId() {
- return routeId;
- }
-
- public String getShortExchangeId() {
- return shortExchangeId;
- }
-
- public String getExchangePattern() {
- return exchangePattern;
- }
-
- public String getProperties() {
- return properties;
- }
-
- public String getHeaders() {
- return headers;
- }
-
- public String getBody() {
- return body;
- }
-
- public String getBodyType() {
- return bodyType;
- }
-
- public String getOutBody() {
- return outBody;
- }
-
- public String getOutBodyType() {
- return outBodyType;
- }
-
- public String getOutHeaders() {
- return outHeaders;
- }
-
- public String getCausedByException() {
- return causedByException;
- }
-
- public void setTimestamp(Date timestamp) {
- this.timestamp = timestamp;
- }
-
- public void setFromEndpointUri(String fromEndpointUri) {
- this.fromEndpointUri = fromEndpointUri;
- }
-
- public void setPreviousNode(String previousNode) {
- this.previousNode = previousNode;
- }
-
- public void setToNode(String toNode) {
- this.toNode = toNode;
- }
-
- public void setExchangeId(String exchangeId) {
- this.exchangeId = exchangeId;
- }
-
- public void setRouteId(String routeId) {
- this.routeId = routeId;
- }
-
- public void setShortExchangeId(String shortExchangeId) {
- this.shortExchangeId = shortExchangeId;
- }
-
- public void setExchangePattern(String exchangePattern) {
- this.exchangePattern = exchangePattern;
- }
-
- public void setProperties(String properties) {
- this.properties = properties;
- }
-
- public void setHeaders(String headers) {
- this.headers = headers;
- }
-
- public void setBody(String body) {
- this.body = body;
- }
-
- public void setBodyType(String bodyType) {
- this.bodyType = bodyType;
- }
-
- public void setOutBody(String outBody) {
- this.outBody = outBody;
- }
-
- public void setOutBodyType(String outBodyType) {
- this.outBodyType = outBodyType;
- }
-
- public void setOutHeaders(String outHeaders) {
- this.outHeaders = outHeaders;
- }
-
- public void setCausedByException(String causedByException) {
- this.causedByException = causedByException;
- }
-
- public Exchange getTracedExchange() {
- return tracedExchange;
- }
-
- @Override
- public String toString() {
- return "TraceEventMessage[" + exchangeId + "] on node: " + toNode;
- }
-}
diff --git a/camel-core/src/main/java/org/apache/camel/processor/interceptor/DefaultTraceFormatter.java b/camel-core/src/main/java/org/apache/camel/processor/interceptor/DefaultTraceFormatter.java
deleted file mode 100644
index 7c35952..0000000
--- a/camel-core/src/main/java/org/apache/camel/processor/interceptor/DefaultTraceFormatter.java
+++ /dev/null
@@ -1,402 +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.processor.interceptor;
-
-import org.apache.camel.Exchange;
-import org.apache.camel.Message;
-import org.apache.camel.RouteNode;
-import org.apache.camel.model.ProcessorDefinition;
-import org.apache.camel.model.ProcessorDefinitionHelper;
-import org.apache.camel.model.RouteDefinition;
-import org.apache.camel.spi.TracedRouteNodes;
-import org.apache.camel.util.MessageHelper;
-
-/**
- * @version
- */
-@Deprecated
-public class DefaultTraceFormatter implements TraceFormatter {
-
- protected static final String LS = System.lineSeparator();
- private static final String SEPARATOR = "###REPLACE_ME###";
-
- private int breadCrumbLength;
- private int nodeLength;
- private boolean showBreadCrumb = true;
- private boolean showNode = true;
- private boolean showExchangeId;
- private boolean showShortExchangeId;
- private boolean showExchangePattern = true;
- private boolean showProperties;
- private boolean showHeaders = true;
- private boolean showBody = true;
- private boolean showBodyType = true;
- private boolean showOutHeaders;
- private boolean showOutBody;
- private boolean showOutBodyType;
- private boolean showException = true;
- private boolean showRouteId = true;
- private boolean multiline;
-
- private int maxChars = 10000;
-
- public Object format(final TraceInterceptor interceptor, final ProcessorDefinition<?> node, final Exchange exchange) {
- Message in = exchange.getIn();
- Message out = null;
- if (exchange.hasOut()) {
- out = exchange.getOut();
- }
-
- StringBuilder sb = new StringBuilder();
- if (multiline) {
- sb.append(SEPARATOR);
- }
- sb.append(extractBreadCrumb(interceptor, node, exchange));
-
- if (showExchangePattern) {
- if (multiline) {
- sb.append(SEPARATOR);
- }
- sb.append(", Pattern:").append(exchange.getPattern());
- }
- // only show properties if we have any
- if (showProperties && !exchange.getProperties().isEmpty()) {
- if (multiline) {
- sb.append(SEPARATOR);
- }
- sb.append(", Properties:").append(exchange.getProperties());
- }
- // only show headers if we have any
- if (showHeaders && !in.getHeaders().isEmpty()) {
- if (multiline) {
- sb.append(SEPARATOR);
- }
- sb.append(", Headers:").append(in.getHeaders());
- }
- if (showBodyType) {
- if (multiline) {
- sb.append(SEPARATOR);
- }
- sb.append(", BodyType:").append(MessageHelper.getBodyTypeName(in));
- }
- if (showBody) {
- if (multiline) {
- sb.append(SEPARATOR);
- }
- sb.append(", Body:").append(MessageHelper.extractBodyForLogging(in, ""));
- }
- if (showOutHeaders && out != null) {
- if (multiline) {
- sb.append(SEPARATOR);
- }
- sb.append(", OutHeaders:").append(out.getHeaders());
- }
- if (showOutBodyType && out != null) {
- if (multiline) {
- sb.append(SEPARATOR);
- }
- sb.append(", OutBodyType:").append(MessageHelper.getBodyTypeName(out));
- }
- if (showOutBody && out != null) {
- if (multiline) {
- sb.append(SEPARATOR);
- }
- sb.append(", OutBody:").append(MessageHelper.extractBodyForLogging(out, ""));
- }
- if (showException && exchange.getException() != null) {
- if (multiline) {
- sb.append(SEPARATOR);
- }
- sb.append(", Exception:").append(exchange.getException());
- }
-
- // replace ugly <<<, with <<<
- sb = new StringBuilder(sb.toString().replaceFirst("<<<,", "<<<"));
-
- if (maxChars > 0) {
- StringBuilder answer = new StringBuilder();
- for (String s : sb.toString().split(SEPARATOR)) {
- if (s != null) {
- if (s.length() > maxChars) {
- s = s.substring(0, maxChars);
- answer.append(s).append("...");
- } else {
- answer.append(s);
- }
- if (multiline) {
- answer.append(LS);
- }
- }
- }
-
- // switch string buffer
- sb = answer;
- }
-
- return sb.toString();
- }
-
- public boolean isShowBody() {
- return showBody;
- }
-
- public void setShowBody(boolean showBody) {
- this.showBody = showBody;
- }
-
- public boolean isShowBodyType() {
- return showBodyType;
- }
-
- public void setShowBodyType(boolean showBodyType) {
- this.showBodyType = showBodyType;
- }
-
- public void setShowOutBody(boolean showOutBody) {
- this.showOutBody = showOutBody;
- }
-
- public boolean isShowOutBody() {
- return showOutBody;
- }
-
- public void setShowOutBodyType(boolean showOutBodyType) {
- this.showOutBodyType = showOutBodyType;
- }
-
- public boolean isShowOutBodyType() {
- return showOutBodyType;
- }
-
- public boolean isShowBreadCrumb() {
- return showBreadCrumb;
- }
-
- public void setShowBreadCrumb(boolean showBreadCrumb) {
- this.showBreadCrumb = showBreadCrumb;
- }
-
- public boolean isShowExchangeId() {
- return showExchangeId;
- }
-
- public void setShowExchangeId(boolean showExchangeId) {
- this.showExchangeId = showExchangeId;
- }
-
- public boolean isShowHeaders() {
- return showHeaders;
- }
-
- public void setShowHeaders(boolean showHeaders) {
- this.showHeaders = showHeaders;
- }
-
- public boolean isShowOutHeaders() {
- return showOutHeaders;
- }
-
- public void setShowOutHeaders(boolean showOutHeaders) {
- this.showOutHeaders = showOutHeaders;
- }
-
- public boolean isShowProperties() {
- return showProperties;
- }
-
- public void setShowProperties(boolean showProperties) {
- this.showProperties = showProperties;
- }
-
- public boolean isShowNode() {
- return showNode;
- }
-
- public void setShowNode(boolean showNode) {
- this.showNode = showNode;
- }
-
- public boolean isShowExchangePattern() {
- return showExchangePattern;
- }
-
- public void setShowExchangePattern(boolean showExchangePattern) {
- this.showExchangePattern = showExchangePattern;
- }
-
- public boolean isShowException() {
- return showException;
- }
-
- public void setShowException(boolean showException) {
- this.showException = showException;
- }
-
- public boolean isShowRouteId() {
- return showRouteId;
- }
-
- public void setShowRouteId(boolean showRouteId) {
- this.showRouteId = showRouteId;
- }
-
- public boolean isMultiline() {
- return multiline;
- }
-
- public void setMultiline(boolean multiline) {
- this.multiline = multiline;
- }
-
- public int getBreadCrumbLength() {
- return breadCrumbLength;
- }
-
- public void setBreadCrumbLength(int breadCrumbLength) {
- this.breadCrumbLength = breadCrumbLength;
- }
-
- public boolean isShowShortExchangeId() {
- return showShortExchangeId;
- }
-
- public void setShowShortExchangeId(boolean showShortExchangeId) {
- this.showShortExchangeId = showShortExchangeId;
- }
-
- public int getNodeLength() {
- return nodeLength;
- }
-
- public void setNodeLength(int nodeLength) {
- this.nodeLength = nodeLength;
- }
-
- public int getMaxChars() {
- return maxChars;
- }
-
- public void setMaxChars(int maxChars) {
- this.maxChars = maxChars;
- }
-
- // Implementation methods
- //-------------------------------------------------------------------------
-
- protected String extractRoute(ProcessorDefinition<?> node) {
- RouteDefinition route = ProcessorDefinitionHelper.getRoute(node);
- if (route != null) {
- return route.getId();
- } else {
- return null;
- }
- }
-
- protected Object getBreadCrumbID(Exchange exchange) {
- return exchange.getExchangeId();
- }
-
- protected String getNodeMessage(RouteNode entry, Exchange exchange) {
- String message = entry.getLabel(exchange);
- if (nodeLength > 0) {
- return String.format("%1$-" + nodeLength + "." + nodeLength + "s", message);
- } else {
- return message;
- }
- }
-
- /**
- * Creates the breadcrumb based on whether this was a trace of
- * an exchange coming out of or into a processing step. For example,
- * <br/><tt>transform(body) -> ID-mojo/39713-1225468755256/2-0</tt>
- * <br/>or
- * <br/><tt>ID-mojo/39713-1225468755256/2-0 -> transform(body)</tt>
- */
- protected String extractBreadCrumb(TraceInterceptor interceptor, ProcessorDefinition<?> currentNode, Exchange exchange) {
- String id = "";
- String result;
-
- if (!showBreadCrumb && !showExchangeId && !showShortExchangeId && !showNode) {
- return "";
- }
-
- // compute breadcrumb id
- if (showBreadCrumb) {
- id = getBreadCrumbID(exchange).toString();
- } else if (showExchangeId || showShortExchangeId) {
- id = getBreadCrumbID(exchange).toString();
- if (showShortExchangeId) {
- // only output last part of id
- id = id.substring(id.lastIndexOf('-') + 1);
- }
- }
-
- // compute from, to and route
- String from = "";
- String to = "";
- String route = "";
- if (showNode || showRouteId) {
- if (exchange.getUnitOfWork() != null) {
- TracedRouteNodes traced = exchange.getUnitOfWork().getTracedRouteNodes();
- if (traced != null) {
- RouteNode traceFrom = traced.getSecondLastNode();
- if (traceFrom != null) {
- from = getNodeMessage(traceFrom, exchange);
- } else if (exchange.getFromEndpoint() != null) {
- from = "from(" + exchange.getFromEndpoint().getEndpointUri() + ")";
- }
-
- RouteNode traceTo = traced.getLastNode();
- if (traceTo != null) {
- to = getNodeMessage(traceTo, exchange);
- // if its an abstract dummy holder then we have to get the 2nd last so we can get the real node that has
- // information which route it belongs to
- if (traceTo.isAbstract() && traceTo.getProcessorDefinition() == null) {
- traceTo = traced.getSecondLastNode();
- }
- if (traceTo != null) {
- route = extractRoute(traceTo.getProcessorDefinition());
- }
- }
- }
- }
- }
-
- // assemble result with and without the to/from
- if (showNode) {
- if (showRouteId && route != null) {
- result = id.trim() + " >>> (" + route + ") " + from + " --> " + to.trim() + " <<< ";
- } else {
- result = id.trim() + " >>> " + from + " --> " + to.trim() + " <<< ";
- }
-
- if (interceptor.shouldTraceOutExchanges() && exchange.hasOut()) {
- result += " (OUT) ";
- }
- } else {
- result = id;
- }
-
- if (breadCrumbLength > 0) {
- // we want to ensure text coming after this is aligned for readability
- return String.format("%1$-" + breadCrumbLength + "." + breadCrumbLength + "s", result.trim());
- } else {
- return result.trim();
- }
- }
-
-}
diff --git a/camel-core/src/main/java/org/apache/camel/processor/interceptor/DefaultTraceInterceptorFactory.java b/camel-core/src/main/java/org/apache/camel/processor/interceptor/DefaultTraceInterceptorFactory.java
deleted file mode 100644
index 87aee7c..0000000
--- a/camel-core/src/main/java/org/apache/camel/processor/interceptor/DefaultTraceInterceptorFactory.java
+++ /dev/null
@@ -1,29 +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.processor.interceptor;
-
-import org.apache.camel.Processor;
-import org.apache.camel.model.ProcessorDefinition;
-
-@Deprecated
-public class DefaultTraceInterceptorFactory implements TraceInterceptorFactory {
-
- public Processor createTraceInterceptor(ProcessorDefinition<?> node, Processor target, TraceFormatter formatter, Tracer tracer) {
- return new TraceInterceptor(node, target, formatter, tracer);
- }
-
-}
diff --git a/camel-core/src/main/java/org/apache/camel/processor/interceptor/TraceEventHandler.java b/camel-core/src/main/java/org/apache/camel/processor/interceptor/TraceEventHandler.java
deleted file mode 100644
index d43378c..0000000
--- a/camel-core/src/main/java/org/apache/camel/processor/interceptor/TraceEventHandler.java
+++ /dev/null
@@ -1,73 +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.processor.interceptor;
-
-import org.apache.camel.Exchange;
-import org.apache.camel.Processor;
-import org.apache.camel.model.ProcessorDefinition;
-
-/**
- * A handler which reacts on trace events.
- */
-@Deprecated
-public interface TraceEventHandler {
-
- /**
- * Event called when an {@link Exchange} is about to be processed
- * <p/>
- * This event is only called if trace out has been disabled (which it is by default).
- * <p/>
- * This method is for coarse grained tracing, where as the other two methods is for fine grained
- * with in and event events.
- *
- * @param node the current node
- * @param target the current processor being invoked
- * @param traceInterceptor the trace interceptor
- * @param exchange the current exchange
- * @throws Exception is thrown if an error occurred during tracing
- */
- void traceExchange(ProcessorDefinition<?> node, Processor target, TraceInterceptor traceInterceptor, Exchange exchange) throws Exception;
-
- /**
- * Event called when an {@link Exchange} is about to be processed (in)
- * <p/>
- * This event is only called if trace out has been enabled.
- *
- * @param node the current node
- * @param target the current processor being invoked
- * @param traceInterceptor the trace interceptor
- * @param exchange the current exchange
- * @return an optional return object to pass in the <tt>traceEventOut</tt> method.
- * @throws Exception is thrown if an error occurred during tracing
- */
- Object traceExchangeIn(ProcessorDefinition<?> node, Processor target, TraceInterceptor traceInterceptor, Exchange exchange) throws Exception;
-
- /**
- * Event called when an {@link Exchange} has been processed (out)
- * <p/>
- * This event is only called if trace out has been enabled.
- *
- * @param node the current node
- * @param target the current processor being invoked
- * @param traceInterceptor the trace interceptor
- * @param exchange the current exchange (contains exception if the processing failed with an exception)
- * @param traceState the optional object which was returned from the <tt>traceEventIn</tt> method.
- * @throws Exception is thrown if an error occurred during tracing
- */
- void traceExchangeOut(ProcessorDefinition<?> node, Processor target, TraceInterceptor traceInterceptor, Exchange exchange, Object traceState) throws Exception;
-
-}
diff --git a/camel-core/src/main/java/org/apache/camel/processor/interceptor/TraceEventMessage.java b/camel-core/src/main/java/org/apache/camel/processor/interceptor/TraceEventMessage.java
deleted file mode 100644
index ef095ad..0000000
--- a/camel-core/src/main/java/org/apache/camel/processor/interceptor/TraceEventMessage.java
+++ /dev/null
@@ -1,98 +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.processor.interceptor;
-
-import java.util.Date;
-
-import org.apache.camel.Exchange;
-
-/**
- * A trace event message that contains decomposed information about the traced
- * {@link org.apache.camel.Exchange} at the point of interception. The information is stored as snapshot copies
- * using String types.
- * <p/>
- * Notice not all implementations may provide direct access to the traced {@link Exchange} using
- * the {@link #getTracedExchange()} method, and thus this method may return <tt>null</tt>.
- * For example the JPA implementation will return <tt>null</tt>.
- */
-public interface TraceEventMessage {
-
- /**
- * Gets the timestamp when the interception occurred
- */
- Date getTimestamp();
-
- /**
- * Uri of the endpoint that started the {@link org.apache.camel.Exchange} currently being traced.
- */
- String getFromEndpointUri();
-
- /**
- * Gets the previous node.
- * <p/>
- * Will return <tt>null</tt> if this is the first node, then you can use the from endpoint uri
- * instead to indicate the start
- */
- String getPreviousNode();
-
- /**
- * Gets the current node that just have been intercepted and processed
- * <p/>
- * Is never <tt>null</tt>.
- */
- String getToNode();
-
- String getExchangeId();
-
- String getRouteId();
-
- /**
- * Gets the exchange id without the leading hostname
- */
- String getShortExchangeId();
-
- String getExchangePattern();
-
- String getProperties();
-
- String getHeaders();
-
- String getBody();
-
- String getBodyType();
-
- String getOutBody();
-
- String getOutBodyType();
-
- String getOutHeaders();
-
- /**
- * Gets the caused by exception (ie {@link org.apache.camel.Exchange#getException() Exchange#getException()}.
- */
- String getCausedByException();
-
- /**
- * Gets the traced {@link Exchange}.
- * <p/>
- * Not all implementations may provide direct access to the traced {@link Exchange} and thus this
- * method may return <tt>null</tt>. For example the JPA implementation will return <tt>null</tt>.
- *
- * @return the traced {@link Exchange}, however it can be <tt>null</tt> in some implementations.
- */
- Exchange getTracedExchange();
-}
diff --git a/camel-core/src/main/java/org/apache/camel/processor/interceptor/TraceFormatter.java b/camel-core/src/main/java/org/apache/camel/processor/interceptor/TraceFormatter.java
deleted file mode 100644
index 91fc147..0000000
--- a/camel-core/src/main/java/org/apache/camel/processor/interceptor/TraceFormatter.java
+++ /dev/null
@@ -1,37 +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.processor.interceptor;
-
-import org.apache.camel.Exchange;
-import org.apache.camel.model.ProcessorDefinition;
-
-/**
- * Formatter to format trace logs when tracing {@link Exchange} during routing.
- */
-@Deprecated
-public interface TraceFormatter {
-
- /**
- * Formats a log message at given point of interception.
- *
- * @param interceptor the tracing interceptor
- * @param node the node where the interception occurred
- * @param exchange the current exchange
- * @return the log message
- */
- Object format(TraceInterceptor interceptor, ProcessorDefinition<?> node, Exchange exchange);
-}
diff --git a/camel-core/src/main/java/org/apache/camel/processor/interceptor/TraceInterceptor.java b/camel-core/src/main/java/org/apache/camel/processor/interceptor/TraceInterceptor.java
deleted file mode 100644
index 8bad774..0000000
--- a/camel-core/src/main/java/org/apache/camel/processor/interceptor/TraceInterceptor.java
+++ /dev/null
@@ -1,390 +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.processor.interceptor;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.camel.AsyncCallback;
-import org.apache.camel.Exchange;
-import org.apache.camel.Processor;
-import org.apache.camel.impl.AggregateRouteNode;
-import org.apache.camel.impl.DefaultRouteNode;
-import org.apache.camel.impl.DoCatchRouteNode;
-import org.apache.camel.impl.DoFinallyRouteNode;
-import org.apache.camel.impl.OnCompletionRouteNode;
-import org.apache.camel.impl.OnExceptionRouteNode;
-import org.apache.camel.model.AggregateDefinition;
-import org.apache.camel.model.CatchDefinition;
-import org.apache.camel.model.Constants;
-import org.apache.camel.model.FinallyDefinition;
-import org.apache.camel.model.InterceptDefinition;
-import org.apache.camel.model.OnCompletionDefinition;
-import org.apache.camel.model.OnExceptionDefinition;
-import org.apache.camel.model.ProcessorDefinition;
-import org.apache.camel.model.ProcessorDefinitionHelper;
-import org.apache.camel.processor.CamelLogProcessor;
-import org.apache.camel.processor.DefaultMaskingFormatter;
-import org.apache.camel.processor.DelegateAsyncProcessor;
-import org.apache.camel.spi.ExchangeFormatter;
-import org.apache.camel.spi.InterceptStrategy;
-import org.apache.camel.spi.MaskingFormatter;
-import org.apache.camel.spi.RouteContext;
-import org.apache.camel.spi.TracedRouteNodes;
-import org.apache.camel.util.ServiceHelper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * An interceptor for debugging and tracing routes
- *
- * @version
- */
-@Deprecated
-public class TraceInterceptor extends DelegateAsyncProcessor implements ExchangeFormatter {
- private static final Logger LOG = LoggerFactory.getLogger(TraceInterceptor.class);
-
- private CamelLogProcessor logger;
-
- private final ProcessorDefinition<?> node;
- private final Tracer tracer;
- private TraceFormatter formatter;
-
- private RouteContext routeContext;
- private List<TraceEventHandler> traceHandlers;
-
- public TraceInterceptor(ProcessorDefinition<?> node, Processor target, TraceFormatter formatter, Tracer tracer) {
- super(target);
- this.tracer = tracer;
- this.node = node;
- this.formatter = formatter;
- this.logger = tracer.getLogger(this);
- if (tracer.getFormatter() != null) {
- this.formatter = tracer.getFormatter();
- }
- this.traceHandlers = tracer.getTraceHandlers();
- }
-
- @Override
- public String toString() {
- return "TraceInterceptor[" + node + "]";
- }
-
- public void setRouteContext(RouteContext routeContext) {
- this.routeContext = routeContext;
- prepareMaskingFormatter(routeContext);
- }
-
- private void prepareMaskingFormatter(RouteContext routeContext) {
- if (routeContext.isLogMask()) {
- MaskingFormatter formatter = routeContext.getCamelContext().getRegistry().lookupByNameAndType(Constants.CUSTOM_LOG_MASK_REF, MaskingFormatter.class);
- if (formatter == null) {
- formatter = new DefaultMaskingFormatter();
- }
- logger.setMaskingFormatter(formatter);
- }
- }
-
- @Override
- public boolean process(final Exchange exchange, final AsyncCallback callback) {
- // do not trace if tracing is disabled
- if (!tracer.isEnabled() || (routeContext != null && !routeContext.isTracing())) {
- return processor.process(exchange, callback);
- }
-
- // interceptor will also trace routes supposed only for TraceEvents so we need to skip
- // logging TraceEvents to avoid infinite looping
- if (exchange.getProperty(Exchange.TRACE_EVENT, false, Boolean.class)) {
- // but we must still process to allow routing of TraceEvents to eg a JPA endpoint
- return processor.process(exchange, callback);
- }
-
- final boolean shouldLog = shouldLogNode(node) && shouldLogExchange(exchange);
-
- // whether we should trace it or not, some nodes should be skipped as they are abstract
- // intermediate steps for instance related to on completion
- boolean trace = true;
- boolean sync = true;
-
- // okay this is a regular exchange being routed we might need to log and trace
- try {
- // before
- if (shouldLog) {
- // traced holds the information about the current traced route path
- if (exchange.getUnitOfWork() != null) {
- TracedRouteNodes traced = exchange.getUnitOfWork().getTracedRouteNodes();
- if (traced != null) {
- if (node instanceof OnCompletionDefinition || node instanceof OnExceptionDefinition) {
- // skip any of these as its just a marker definition
- trace = false;
- } else if (ProcessorDefinitionHelper.isFirstChildOfType(OnCompletionDefinition.class, node)) {
- // special for on completion tracing
- traceOnCompletion(traced, exchange);
- } else if (ProcessorDefinitionHelper.isFirstChildOfType(OnExceptionDefinition.class, node)) {
- // special for on exception
- traceOnException(traced, exchange);
- } else if (ProcessorDefinitionHelper.isFirstChildOfType(CatchDefinition.class, node)) {
- // special for do catch
- traceDoCatch(traced, exchange);
- } else if (ProcessorDefinitionHelper.isFirstChildOfType(FinallyDefinition.class, node)) {
- // special for do finally
- traceDoFinally(traced, exchange);
- } else if (ProcessorDefinitionHelper.isFirstChildOfType(AggregateDefinition.class, node)) {
- // special for aggregate
- traceAggregate(traced, exchange);
- } else {
- // regular so just add it
- traced.addTraced(new DefaultRouteNode(node, super.getProcessor()));
- }
- }
- } else {
- LOG.trace("Cannot trace as this Exchange does not have an UnitOfWork: {}", exchange);
- }
- }
-
- // log and trace the processor
- Object state = null;
- if (shouldLog && trace) {
- logExchange(exchange);
- // either call the in or generic trace method depending on OUT has been enabled or not
- if (tracer.isTraceOutExchanges()) {
- state = traceExchangeIn(exchange);
- } else {
- traceExchange(exchange);
- }
- }
- final Object traceState = state;
-
- // special for interceptor where we need to keep booking how far we have routed in the intercepted processors
- if (node.getParent() instanceof InterceptDefinition && exchange.getUnitOfWork() != null) {
- TracedRouteNodes traced = exchange.getUnitOfWork().getTracedRouteNodes();
- if (traced != null) {
- traceIntercept((InterceptDefinition) node.getParent(), traced, exchange);
- }
- }
-
- // process the exchange
- sync = processor.process(exchange, new AsyncCallback() {
- @Override
- public void done(boolean doneSync) {
- try {
- // after (trace out)
- if (shouldLog && tracer.isTraceOutExchanges()) {
- logExchange(exchange);
- traceExchangeOut(exchange, traceState);
- }
- } catch (Throwable e) {
- // some exception occurred in trace logic
- if (shouldLogException(exchange)) {
- logException(exchange, e);
- }
- exchange.setException(e);
- } finally {
- // ensure callback is always invoked
- callback.done(doneSync);
- }
- }
- });
-
- } catch (Throwable e) {
- // some exception occurred in trace logic
- if (shouldLogException(exchange)) {
- logException(exchange, e);
- }
- exchange.setException(e);
- }
-
- return sync;
- }
-
- private void traceOnCompletion(TracedRouteNodes traced, Exchange exchange) {
- traced.addTraced(new OnCompletionRouteNode());
- // do not log and trace as onCompletion should be a new event on its own
- // add the next step as well so we have onCompletion -> new step
- traced.addTraced(new DefaultRouteNode(node, super.getProcessor()));
- }
-
- private void traceOnException(TracedRouteNodes traced, Exchange exchange) throws Exception {
- if (traced.getLastNode() != null) {
- traced.addTraced(new DefaultRouteNode(traced.getLastNode().getProcessorDefinition(), traced.getLastNode().getProcessor()));
- }
- traced.addTraced(new OnExceptionRouteNode());
- // log and trace so we have the from -> onException event as well
- logExchange(exchange);
- traceExchange(exchange);
- traced.addTraced(new DefaultRouteNode(node, super.getProcessor()));
- }
-
- private void traceDoCatch(TracedRouteNodes traced, Exchange exchange) throws Exception {
- if (traced.getLastNode() != null) {
- traced.addTraced(new DefaultRouteNode(traced.getLastNode().getProcessorDefinition(), traced.getLastNode().getProcessor()));
- }
- traced.addTraced(new DoCatchRouteNode());
- // log and trace so we have the from -> doCatch event as well
- logExchange(exchange);
- traceExchange(exchange);
- traced.addTraced(new DefaultRouteNode(node, super.getProcessor()));
- }
-
- private void traceDoFinally(TracedRouteNodes traced, Exchange exchange) throws Exception {
- if (traced.getLastNode() != null) {
- traced.addTraced(new DefaultRouteNode(traced.getLastNode().getProcessorDefinition(), traced.getLastNode().getProcessor()));
- }
- traced.addTraced(new DoFinallyRouteNode());
- // log and trace so we have the from -> doFinally event as well
- logExchange(exchange);
- traceExchange(exchange);
- traced.addTraced(new DefaultRouteNode(node, super.getProcessor()));
- }
-
- private void traceAggregate(TracedRouteNodes traced, Exchange exchange) {
- traced.addTraced(new AggregateRouteNode((AggregateDefinition) node.getParent()));
- traced.addTraced(new DefaultRouteNode(node, super.getProcessor()));
- }
-
- protected void traceIntercept(InterceptDefinition intercept, TracedRouteNodes traced, Exchange exchange) throws Exception {
- // use the counter to get the index of the intercepted processor to be traced
- Processor last = intercept.getInterceptedProcessor(traced.getAndIncrementCounter(intercept));
- // skip doing any double tracing of interceptors, so the last must not be a TraceInterceptor instance
- if (last != null && !(last instanceof TraceInterceptor)) {
- traced.addTraced(new DefaultRouteNode(node, last));
-
- boolean shouldLog = shouldLogNode(node) && shouldLogExchange(exchange);
- if (shouldLog) {
- // log and trace the processor that was intercepted so we can see it
- logExchange(exchange);
- traceExchange(exchange);
- }
- }
- }
-
- public String format(Exchange exchange) {
- Object msg = formatter.format(this, this.getNode(), exchange);
- if (msg != null) {
- return msg.toString();
- } else {
- return null;
- }
- }
-
- // Properties
- //-------------------------------------------------------------------------
- public ProcessorDefinition<?> getNode() {
- return node;
- }
-
- public CamelLogProcessor getLogger() {
- return logger;
- }
-
- public TraceFormatter getFormatter() {
- return formatter;
- }
-
- public Tracer getTracer() {
- return tracer;
- }
-
- protected void logExchange(Exchange exchange) throws Exception {
- // process the exchange that formats and logs it
- logger.process(exchange);
- }
-
- protected void traceExchange(Exchange exchange) throws Exception {
- for (TraceEventHandler traceHandler : traceHandlers) {
- traceHandler.traceExchange(node, processor, this, exchange);
- }
- }
-
- protected Object traceExchangeIn(Exchange exchange) throws Exception {
- Object result = null;
- for (TraceEventHandler traceHandler : traceHandlers) {
- Object result1 = traceHandler.traceExchangeIn(node, processor, this, exchange);
- if (result1 != null) {
- result = result1;
- }
- }
- return result;
- }
-
- protected void traceExchangeOut(Exchange exchange, Object traceState) throws Exception {
- for (TraceEventHandler traceHandler : traceHandlers) {
- traceHandler.traceExchangeOut(node, processor, this, exchange, traceState);
- }
- }
-
- protected void logException(Exchange exchange, Throwable throwable) {
- if (tracer.isTraceExceptions()) {
- if (tracer.isLogStackTrace()) {
- logger.process(exchange, throwable);
- } else {
- logger.process(exchange, ", Exception: " + throwable.toString());
- }
- }
- }
-
- /**
- * Returns true if the given exchange should be logged in the trace list
- */
- protected boolean shouldLogExchange(Exchange exchange) {
- return tracer.isEnabled() && (tracer.getTraceFilter() == null || tracer.getTraceFilter().matches(exchange));
- }
-
- /**
- * Returns true if the given exchange should be logged when an exception was thrown
- */
- protected boolean shouldLogException(Exchange exchange) {
- return tracer.isTraceExceptions();
- }
-
- /**
- * Returns whether exchanges coming out of processors should be traced
- */
- public boolean shouldTraceOutExchanges() {
- return tracer.isTraceOutExchanges();
- }
-
- /**
- * Returns true if the given node should be logged in the trace list
- */
- protected boolean shouldLogNode(ProcessorDefinition<?> node) {
- if (node == null) {
- return false;
- }
- if (!tracer.isTraceInterceptors() && (node instanceof InterceptStrategy)) {
- return false;
- }
- return true;
- }
-
- @Override
- protected void doStart() throws Exception {
- super.doStart();
- ServiceHelper.startService(traceHandlers);
- }
-
- @Override
- protected void doStop() throws Exception {
- super.doStop();
- ServiceHelper.stopService(traceHandlers);
- }
-
- @Deprecated
- public void setTraceHandler(TraceEventHandler traceHandler) {
- traceHandlers = Collections.singletonList(traceHandler);
- }
-}
diff --git a/camel-core/src/main/java/org/apache/camel/processor/interceptor/TraceInterceptorFactory.java b/camel-core/src/main/java/org/apache/camel/processor/interceptor/TraceInterceptorFactory.java
deleted file mode 100644
index 51eaeb5..0000000
--- a/camel-core/src/main/java/org/apache/camel/processor/interceptor/TraceInterceptorFactory.java
+++ /dev/null
@@ -1,44 +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.processor.interceptor;
-
-import org.apache.camel.Processor;
-import org.apache.camel.model.ProcessorDefinition;
-
-/**
- * Factory to create the trace interceptor.
- */
-@Deprecated
-public interface TraceInterceptorFactory {
-
- /**
- * Create a trace interceptor.
- * <p/>
- * It is expected that the factory will create a subclass of {@link TraceInterceptor},
- * however any Processor will suffice.
- * <p/>
- * Use this factory to take more control of how trace events are persisted.
- *
- * @param node the current node
- * @param target the current target
- * @param formatter the trace formatter
- * @param tracer the tracer
- * @return the created trace interceptor
- */
- Processor createTraceInterceptor(ProcessorDefinition<?> node, Processor target, TraceFormatter formatter, Tracer tracer);
-
-}
diff --git a/camel-core/src/main/java/org/apache/camel/processor/interceptor/Tracer.java b/camel-core/src/main/java/org/apache/camel/processor/interceptor/Tracer.java
deleted file mode 100644
index df5e04b..0000000
--- a/camel-core/src/main/java/org/apache/camel/processor/interceptor/Tracer.java
+++ /dev/null
@@ -1,374 +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.processor.interceptor;
-
-import java.util.List;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.Endpoint;
-import org.apache.camel.LoggingLevel;
-import org.apache.camel.Predicate;
-import org.apache.camel.Processor;
-import org.apache.camel.Service;
-import org.apache.camel.model.ProcessorDefinition;
-import org.apache.camel.model.RouteDefinitionHelper;
-import org.apache.camel.processor.CamelLogProcessor;
-import org.apache.camel.spi.ExchangeFormatter;
-import org.apache.camel.spi.InterceptStrategy;
-import org.apache.camel.util.CamelLogger;
-
-/**
- * An interceptor strategy for tracing routes
- *
- * @version
- */
-@Deprecated
-public class Tracer implements InterceptStrategy, Service {
- private static final String JPA_TRACE_EVENT_MESSAGE = "org.apache.camel.processor.interceptor.jpa.JpaTraceEventMessage";
-
- private TraceFormatter formatter = new DefaultTraceFormatter();
- private boolean enabled = true;
- private String logName = Tracer.class.getName();
- private LoggingLevel logLevel = LoggingLevel.INFO;
- private Predicate traceFilter;
- private boolean traceInterceptors;
- private boolean traceExceptions = true;
- private boolean logStackTrace;
- private boolean traceOutExchanges;
- private String destinationUri;
- private Endpoint destination;
- private boolean useJpa;
- private CamelLogProcessor logger;
- private TraceInterceptorFactory traceInterceptorFactory = new DefaultTraceInterceptorFactory();
- private final List<TraceEventHandler> traceHandlers = new CopyOnWriteArrayList<>();
- private String jpaTraceEventMessageClassName = JPA_TRACE_EVENT_MESSAGE;
- private boolean jmxTraceNotifications;
- private int traceBodySize = 10000;
-
- public Tracer() {
- traceHandlers.add(new DefaultTraceEventHandler(this));
- }
-
- /**
- * Creates a new tracer.
- *
- * @param context Camel context
- * @return a new tracer
- */
- public static Tracer createTracer(CamelContext context) {
- Tracer tracer = new Tracer();
- // lets see if we have a formatter if so use it
- TraceFormatter formatter = context.getRegistry().lookupByNameAndType("traceFormatter", TraceFormatter.class);
- if (formatter != null) {
- tracer.setFormatter(formatter);
- }
- return tracer;
- }
-
- /**
- * A helper method to return the Tracer instance if one is enabled
- *
- * @return the tracer or null if none can be found
- */
- public static Tracer getTracer(CamelContext context) {
- List<InterceptStrategy> list = context.getInterceptStrategies();
- for (InterceptStrategy interceptStrategy : list) {
- if (interceptStrategy instanceof Tracer) {
- return (Tracer) interceptStrategy;
- }
- }
- return null;
- }
-
- /**
- * Gets the logger to be used for tracers that can format and log a given exchange.
- *
- * @param formatter the exchange formatter
- * @return the logger to use
- */
- public synchronized CamelLogProcessor getLogger(ExchangeFormatter formatter) {
- if (logger == null) {
- logger = new CamelLogProcessor(new CamelLogger(getLogName(), getLogLevel()), formatter, null, null);
- }
- return logger;
- }
-
- public Processor wrapProcessorInInterceptors(CamelContext context, ProcessorDefinition<?> definition,
- Processor target, Processor nextTarget) throws Exception {
- // Force the creation of an id, otherwise the id is not available when the trace formatter is
- // outputting trace information
- RouteDefinitionHelper.forceAssignIds(context, definition);
- return getTraceInterceptorFactory().createTraceInterceptor(definition, target, formatter, this);
- }
-
- public TraceFormatter getFormatter() {
- return formatter;
- }
-
- public DefaultTraceFormatter getDefaultTraceFormatter() {
- if (formatter instanceof DefaultTraceFormatter) {
- return (DefaultTraceFormatter) formatter;
- }
- return null;
- }
-
- public void setFormatter(TraceFormatter formatter) {
- this.formatter = formatter;
- }
-
- public void setEnabled(boolean flag) {
- enabled = flag;
- }
-
- public boolean isEnabled() {
- return enabled;
- }
-
- public boolean isTraceInterceptors() {
- return traceInterceptors;
- }
-
- /**
- * Sets whether interceptors should be traced or not
- */
- public void setTraceInterceptors(boolean traceInterceptors) {
- this.traceInterceptors = traceInterceptors;
- }
-
- public Predicate getTraceFilter() {
- return traceFilter;
- }
-
- /**
- * Sets a predicate to be used as filter when tracing
- */
- public void setTraceFilter(Predicate traceFilter) {
- this.traceFilter = traceFilter;
- }
-
- public LoggingLevel getLogLevel() {
- return logLevel;
- }
-
- /**
- * Sets the logging level to output tracing. Will use <tt>INFO</tt> level by default.
- */
- public void setLogLevel(LoggingLevel logLevel) {
- this.logLevel = logLevel;
- // update logger if its in use
- if (logger != null) {
- logger.getLogger().setLevel(logLevel);
- }
- }
-
- public boolean isTraceExceptions() {
- return traceExceptions;
- }
-
- /**
- * Sets whether thrown exceptions should be traced
- */
- public void setTraceExceptions(boolean traceExceptions) {
- this.traceExceptions = traceExceptions;
- }
-
- public boolean isLogStackTrace() {
- return logStackTrace;
- }
-
- /**
- * Sets whether thrown exception stacktrace should be traced, if disabled then only the exception message is logged
- */
- public void setLogStackTrace(boolean logStackTrace) {
- this.logStackTrace = logStackTrace;
- }
-
- public String getLogName() {
- return logName;
- }
-
- /**
- * Sets the logging name to use.
- * Will default use <tt>org.apache.camel.processor.interceptor.TraceInterceptor<tt>.
- */
- public void setLogName(String logName) {
- this.logName = logName;
- // update logger if its in use
- if (logger != null) {
- logger.getLogger().setLogName(logName);
- }
- }
-
- /**
- * Sets whether exchanges coming out of processors should be traced
- */
- public void setTraceOutExchanges(boolean traceOutExchanges) {
- this.traceOutExchanges = traceOutExchanges;
- }
-
- public boolean isTraceOutExchanges() {
- return traceOutExchanges;
- }
-
- public String getDestinationUri() {
- return destinationUri;
- }
-
- /**
- * Sets an optional destination to send the traced Exchange.
- * <p/>
- * Can be used to store tracing as files, in a database or whatever. The routing of the Exchange
- * will happen synchronously and the original route will first continue when this destination routing
- * has been completed.
- */
- public void setDestinationUri(String destinationUri) {
- this.destinationUri = destinationUri;
- }
-
- public Endpoint getDestination() {
- return destination;
- }
-
- /**
- * See {@link #setDestinationUri(String)}
- */
- public void setDestination(Endpoint destination) {
- this.destination = destination;
- }
-
- public boolean isUseJpa() {
- return useJpa;
- }
-
- /**
- * Sets whether we should use a JpaTraceEventMessage instead of
- * an ordinary {@link org.apache.camel.processor.interceptor.DefaultTraceEventMessage}
- * <p/>
- * Use this to allow persistence of trace events into a database using JPA.
- * This requires camel-jpa in the classpath.
- */
- public void setUseJpa(boolean useJpa) {
- this.useJpa = useJpa;
- }
-
- public TraceInterceptorFactory getTraceInterceptorFactory() {
- return this.traceInterceptorFactory;
- }
-
- /**
- * Set the factory to be used to create the trace interceptor.
- * It is expected that the factory will create a subclass of TraceInterceptor.
- * <p/>
- * Use this to take complete control of how trace events are handled.
- * The TraceInterceptorFactory should only be set before any routes are created, hence this
- * method is not thread safe.
- */
- public void setTraceInterceptorFactory(TraceInterceptorFactory traceInterceptorFactory) {
- this.traceInterceptorFactory = traceInterceptorFactory;
- }
-
- /**
- *
- * @return the first trace event handler
- */
- @Deprecated
- public TraceEventHandler getTraceHandler() {
- return traceHandlers.get(0);
- }
-
- /**
- *
- * @return list of tracehandlers
- */
- public List<TraceEventHandler> getTraceHandlers() {
- return traceHandlers;
- }
-
- /**
- * Set the object to be used to perform tracing.
- * <p/>
- * Use this to take more control of how trace events are persisted.
- * Setting the traceHandler provides a simpler mechanism for controlling tracing
- * than the TraceInterceptorFactory.
- * The TraceHandler should only be set before any routes are created, hence this
- * method is not thread safe.
- */
- @Deprecated
- public void setTraceHandler(TraceEventHandler traceHandler) {
- this.traceHandlers.clear();
- this.traceHandlers.add(traceHandler);
- }
-
- /**
- * Add the given tracehandler
- */
- public void addTraceHandler(TraceEventHandler traceHandler) {
- this.traceHandlers.add(traceHandler);
- }
-
- /**
- * Remove the given tracehandler
- */
- public void removeTraceHandler(TraceEventHandler traceHandler) {
- this.traceHandlers.remove(traceHandler);
- }
-
- public String getJpaTraceEventMessageClassName() {
- return jpaTraceEventMessageClassName;
- }
-
- /**
- * Set the fully qualified name of the class to be used by the JPA event tracing.
- * <p/>
- * The class must exist in the classpath and be available for dynamic loading.
- * The class name should only be set before any routes are created, hence this
- * method is not thread safe.
- */
- public void setJpaTraceEventMessageClassName(String jpaTraceEventMessageClassName) {
- this.jpaTraceEventMessageClassName = jpaTraceEventMessageClassName;
- }
-
- public boolean isJmxTraceNotifications() {
- return jmxTraceNotifications;
- }
-
- public void setJmxTraceNotifications(boolean jmxTraceNotifications) {
- this.jmxTraceNotifications = jmxTraceNotifications;
- }
-
- public int getTraceBodySize() {
- return traceBodySize;
- }
-
- public void setTraceBodySize(int traceBodySize) {
- this.traceBodySize = traceBodySize;
- }
-
- public void start() throws Exception {
- // noop
- }
-
- public void stop() throws Exception {
- traceHandlers.clear();
- }
-
- @Override
- public String toString() {
- return "Tracer";
- }
-}
diff --git a/camel-core/src/main/java/org/apache/camel/spi/TracedRouteNodes.java b/camel-core/src/main/java/org/apache/camel/spi/TracedRouteNodes.java
deleted file mode 100644
index 40254a2..0000000
--- a/camel-core/src/main/java/org/apache/camel/spi/TracedRouteNodes.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.spi;
-
-import java.util.List;
-
-import org.apache.camel.Exchange;
-import org.apache.camel.RouteNode;
-import org.apache.camel.model.ProcessorDefinition;
-
-/**
- * Tracing information used by {@link org.apache.camel.processor.interceptor.TraceInterceptor}
- * so we can trace the exact route path a given {@link org.apache.camel.Exchange} has been processed.
- *
- * @deprecated use {@link Exchange#MESSAGE_HISTORY} instead.
- */
-@Deprecated
-public interface TracedRouteNodes {
-
- /**
- * Adds the entry that was intercepted
- *
- * @param entry the entry
- */
- void addTraced(RouteNode entry);
-
- /**
- * Gets the last node, is <tt>null</tt> if no last exists.
- *
- * @return the last node
- */
- RouteNode getLastNode();
-
- /**
- * Gets the 2nd last node, is <tt>null</tt> if no last exists.
- *
- * @return the 2nd last
- */
- RouteNode getSecondLastNode();
-
- /**
- * Gets the current list of nodes, representing the route path the
- * current {@link org.apache.camel.Exchange} has currently taken.
- *
- * @return the node path
- */
- List<RouteNode> getNodes();
-
- /**
- * Prepares a new block for tracing.
- * <p/>
- * This is needed when you have child block such as a multicast or aggregator
- */
- void pushBlock();
-
- /**
- * Pops the last block from tracing.
- */
- void popBlock();
-
- /**
- * Clears all traced information
- */
- void clear();
-
- /**
- * A private counter that increments, is used to as book keeping how far this
- * exchange have been intercepted by the general intercept().
- * <p/>
- * We need this special book keeping to keep correct order when dealing
- * with concurrent exchanges being routed in the same route path.
- *
- * @param node the intercept node
- * @return the current count
- */
- int getAndIncrementCounter(ProcessorDefinition<?> node);
-
-}
diff --git a/camel-core/src/main/java/org/apache/camel/spi/UnitOfWork.java b/camel-core/src/main/java/org/apache/camel/spi/UnitOfWork.java
index 0fe1c98..b321ec6 100644
--- a/camel-core/src/main/java/org/apache/camel/spi/UnitOfWork.java
+++ b/camel-core/src/main/java/org/apache/camel/spi/UnitOfWork.java
@@ -118,14 +118,6 @@ public interface UnitOfWork extends Service {
Message getOriginalInMessage();
/**
- * Gets tracing information
- *
- * @return trace information
- */
- @Deprecated
- TracedRouteNodes getTracedRouteNodes();
-
- /**
* Are we transacted?
*
* @return <tt>true</tt> if transacted, <tt>false</tt> otherwise
diff --git a/camel-core/src/test/java/org/apache/camel/component/file/FileSplitInSplitTest.java b/camel-core/src/test/java/org/apache/camel/component/file/FileSplitInSplitTest.java
index 861702b..b5eb602 100644
--- a/camel-core/src/test/java/org/apache/camel/component/file/FileSplitInSplitTest.java
+++ b/camel-core/src/test/java/org/apache/camel/component/file/FileSplitInSplitTest.java
@@ -22,7 +22,6 @@ import org.apache.camel.Exchange;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.model.language.SimpleExpression;
-import org.apache.camel.processor.interceptor.Tracer;
import org.junit.Before;
import org.junit.Test;
@@ -85,9 +84,6 @@ public class FileSplitInSplitTest extends ContextTestSupport {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
- Tracer tracer = new Tracer();
- getContext().addInterceptStrategy(tracer);
-
from("file:target/split?initialDelay=0&delay=10").routeId("foo").noAutoStartup()
.split(body().tokenize(comma))
.parallelProcessing()
diff --git a/camel-core/src/test/java/org/apache/camel/impl/DefaultExecutorServiceStrategyTest.java b/camel-core/src/test/java/org/apache/camel/impl/DefaultExecutorServiceStrategyTest.java
index 1dae1c8..ae0452f 100644
--- a/camel-core/src/test/java/org/apache/camel/impl/DefaultExecutorServiceStrategyTest.java
+++ b/camel-core/src/test/java/org/apache/camel/impl/DefaultExecutorServiceStrategyTest.java
@@ -22,6 +22,7 @@ import java.util.concurrent.TimeUnit;
import org.apache.camel.ContextTestSupport;
import org.apache.camel.ThreadPoolRejectedPolicy;
+import org.apache.camel.spi.ThreadPoolProfile;
import org.apache.camel.util.concurrent.ThreadHelper;
import org.junit.Test;
@@ -149,7 +150,7 @@ public class DefaultExecutorServiceStrategyTest extends ContextTestSupport {
@Test
public void testDefaultUnboundedQueueThreadPool() throws Exception {
- ThreadPoolProfileSupport custom = new ThreadPoolProfileSupport("custom");
+ ThreadPoolProfile custom = new ThreadPoolProfile("custom");
custom.setPoolSize(10);
custom.setMaxPoolSize(30);
custom.setKeepAliveTime(50L);
@@ -174,7 +175,7 @@ public class DefaultExecutorServiceStrategyTest extends ContextTestSupport {
@Test
public void testCustomDefaultThreadPool() throws Exception {
- ThreadPoolProfileSupport custom = new ThreadPoolProfileSupport("custom");
+ ThreadPoolProfile custom = new ThreadPoolProfile("custom");
custom.setKeepAliveTime(20L);
custom.setMaxPoolSize(40);
custom.setPoolSize(5);
@@ -201,7 +202,7 @@ public class DefaultExecutorServiceStrategyTest extends ContextTestSupport {
public void testGetThreadPoolProfile() throws Exception {
assertNull(context.getExecutorServiceStrategy().getThreadPoolProfile("foo"));
- ThreadPoolProfileSupport foo = new ThreadPoolProfileSupport("foo");
+ ThreadPoolProfile foo = new ThreadPoolProfile("foo");
foo.setKeepAliveTime(20L);
foo.setMaxPoolSize(40);
foo.setPoolSize(5);
@@ -216,7 +217,7 @@ public class DefaultExecutorServiceStrategyTest extends ContextTestSupport {
public void testTwoGetThreadPoolProfile() throws Exception {
assertNull(context.getExecutorServiceStrategy().getThreadPoolProfile("foo"));
- ThreadPoolProfileSupport foo = new ThreadPoolProfileSupport("foo");
+ ThreadPoolProfile foo = new ThreadPoolProfile("foo");
foo.setKeepAliveTime(20L);
foo.setMaxPoolSize(40);
foo.setPoolSize(5);
@@ -224,7 +225,7 @@ public class DefaultExecutorServiceStrategyTest extends ContextTestSupport {
context.getExecutorServiceStrategy().registerThreadPoolProfile(foo);
- ThreadPoolProfileSupport bar = new ThreadPoolProfileSupport("bar");
+ ThreadPoolProfile bar = new ThreadPoolProfile("bar");
bar.setKeepAliveTime(40L);
bar.setMaxPoolSize(5);
bar.setPoolSize(1);
@@ -243,7 +244,7 @@ public class DefaultExecutorServiceStrategyTest extends ContextTestSupport {
@Test
public void testGetThreadPoolProfileInheritDefaultValues() throws Exception {
assertNull(context.getExecutorServiceStrategy().getThreadPoolProfile("foo"));
- ThreadPoolProfileSupport foo = new ThreadPoolProfileSupport("foo");
+ ThreadPoolProfile foo = new ThreadPoolProfile("foo");
foo.setMaxPoolSize(40);
context.getExecutorServiceStrategy().registerThreadPoolProfile(foo);
assertSame(foo, context.getExecutorServiceStrategy().getThreadPoolProfile("foo"));
@@ -259,7 +260,7 @@ public class DefaultExecutorServiceStrategyTest extends ContextTestSupport {
@Test
public void testGetThreadPoolProfileInheritCustomDefaultValues() throws Exception {
- ThreadPoolProfileSupport newDefault = new ThreadPoolProfileSupport("newDefault");
+ ThreadPoolProfile newDefault = new ThreadPoolProfile("newDefault");
newDefault.setKeepAliveTime(30L);
newDefault.setMaxPoolSize(50);
newDefault.setPoolSize(5);
@@ -268,7 +269,7 @@ public class DefaultExecutorServiceStrategyTest extends ContextTestSupport {
context.getExecutorServiceStrategy().setDefaultThreadPoolProfile(newDefault);
assertNull(context.getExecutorServiceStrategy().getThreadPoolProfile("foo"));
- ThreadPoolProfileSupport foo = new ThreadPoolProfileSupport("foo");
+ ThreadPoolProfile foo = new ThreadPoolProfile("foo");
foo.setMaxPoolSize(25);
foo.setPoolSize(1);
context.getExecutorServiceStrategy().registerThreadPoolProfile(foo);
@@ -286,13 +287,13 @@ public class DefaultExecutorServiceStrategyTest extends ContextTestSupport {
@Test
public void testGetThreadPoolProfileInheritCustomDefaultValues2() throws Exception {
- ThreadPoolProfileSupport newDefault = new ThreadPoolProfileSupport("newDefault");
+ ThreadPoolProfile newDefault = new ThreadPoolProfile("newDefault");
// just change the max pool as the default profile should then inherit the old default profile
newDefault.setMaxPoolSize(50);
context.getExecutorServiceStrategy().setDefaultThreadPoolProfile(newDefault);
assertNull(context.getExecutorServiceStrategy().getThreadPoolProfile("foo"));
- ThreadPoolProfileSupport foo = new ThreadPoolProfileSupport("foo");
+ ThreadPoolProfile foo = new ThreadPoolProfile("foo");
foo.setPoolSize(1);
context.getExecutorServiceStrategy().registerThreadPoolProfile(foo);
assertSame(foo, context.getExecutorServiceStrategy().getThreadPoolProfile("foo"));
@@ -311,7 +312,7 @@ public class DefaultExecutorServiceStrategyTest extends ContextTestSupport {
public void testNewThreadPoolProfile() throws Exception {
assertNull(context.getExecutorServiceStrategy().getThreadPoolProfile("foo"));
- ThreadPoolProfileSupport foo = new ThreadPoolProfileSupport("foo");
+ ThreadPoolProfile foo = new ThreadPoolProfile("foo");
foo.setKeepAliveTime(20L);
foo.setMaxPoolSize(40);
foo.setPoolSize(5);
@@ -341,7 +342,7 @@ public class DefaultExecutorServiceStrategyTest extends ContextTestSupport {
assertNull(context.getExecutorServiceStrategy().getThreadPoolProfile("fooProfile"));
- ThreadPoolProfileSupport foo = new ThreadPoolProfileSupport("fooProfile");
+ ThreadPoolProfile foo = new ThreadPoolProfile("fooProfile");
foo.setKeepAliveTime(20L);
foo.setMaxPoolSize(40);
foo.setPoolSize(5);
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextTracerTest.java b/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextTracerTest.java
deleted file mode 100644
index d5fe36a..0000000
--- a/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextTracerTest.java
+++ /dev/null
@@ -1,160 +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.management;
-
-import javax.management.Attribute;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
-import org.apache.camel.LoggingLevel;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.processor.interceptor.Tracer;
-import org.junit.Test;
-
-/**
- * @version
- */
-public class ManagedCamelContextTracerTest extends ManagementTestSupport {
-
- @Test
- public void testCamelContextTracing() throws Exception {
- // JMX tests dont work well on AIX CI servers (hangs them)
- if (isPlatform("aix")) {
- return;
- }
-
- MBeanServer mbeanServer = getMBeanServer();
-
- ObjectName camel = ObjectName.getInstance("org.apache.camel:context=camel-1,type=context,name=\"camel-1\"");
- ObjectName on = new ObjectName("org.apache.camel:context=camel-1,type=tracer,name=Tracer");
- mbeanServer.isRegistered(camel);
- mbeanServer.isRegistered(on);
-
- // with tracing
- MockEndpoint traced = getMockEndpoint("mock:traced");
- traced.setExpectedMessageCount(2);
- MockEndpoint result = getMockEndpoint("mock:result");
- result.setExpectedMessageCount(1);
-
- template.sendBody("direct:start", "Hello World");
-
- assertMockEndpointsSatisfied();
-
- // should be enabled
- Boolean tracing = (Boolean) mbeanServer.getAttribute(camel, "Tracing");
- assertEquals("Tracing should be enabled", true, tracing.booleanValue());
-
- String destinationUri = (String) mbeanServer.getAttribute(on, "DestinationUri");
- assertEquals("mock:traced", destinationUri);
-
- String logLevel = (String) mbeanServer.getAttribute(on, "LogLevel");
- assertEquals(LoggingLevel.OFF.name(), logLevel);
-
- String logName = (String) mbeanServer.getAttribute(on, "LogName");
- assertNotNull(logName);
-
- Boolean logStackTrace = (Boolean) mbeanServer.getAttribute(on, "LogStackTrace");
- assertEquals(Boolean.FALSE, logStackTrace);
-
- Boolean traceInterceptors = (Boolean) mbeanServer.getAttribute(on, "TraceInterceptors");
- assertEquals(Boolean.FALSE, traceInterceptors);
-
- Boolean traceExceptions = (Boolean) mbeanServer.getAttribute(on, "TraceExceptions");
- assertEquals(Boolean.TRUE, traceExceptions);
-
- Boolean traceOutExchanges = (Boolean) mbeanServer.getAttribute(on, "TraceOutExchanges");
- assertEquals(Boolean.FALSE, traceOutExchanges);
-
- Boolean formatterShowBody = (Boolean) mbeanServer.getAttribute(on, "FormatterShowBody");
- assertEquals(Boolean.TRUE, formatterShowBody);
-
- Boolean formatterShowBodyType = (Boolean) mbeanServer.getAttribute(on, "FormatterShowBodyType");
- assertEquals(Boolean.TRUE, formatterShowBodyType);
-
- Boolean formatterShowOutBody = (Boolean) mbeanServer.getAttribute(on, "FormatterShowOutBody");
- assertEquals(Boolean.FALSE, formatterShowOutBody);
-
- Boolean formatterShowOutBodyType = (Boolean) mbeanServer.getAttribute(on, "FormatterShowOutBodyType");
- assertEquals(Boolean.FALSE, formatterShowOutBodyType);
-
- Boolean formatterShowBreadCrumb = (Boolean) mbeanServer.getAttribute(on, "FormatterShowBreadCrumb");
- assertEquals(Boolean.TRUE, formatterShowBreadCrumb);
-
- Boolean formatterShowExchangeId = (Boolean) mbeanServer.getAttribute(on, "FormatterShowExchangeId");
- assertEquals(Boolean.FALSE, formatterShowExchangeId);
-
- Boolean formatterShowHeaders = (Boolean) mbeanServer.getAttribute(on, "FormatterShowHeaders");
- assertEquals(Boolean.TRUE, formatterShowHeaders);
-
- Boolean formatterShowOutHeaders = (Boolean) mbeanServer.getAttribute(on, "FormatterShowOutHeaders");
- assertEquals(Boolean.FALSE, formatterShowOutHeaders);
-
- Boolean formatterShowProperties = (Boolean) mbeanServer.getAttribute(on, "FormatterShowProperties");
- assertEquals(Boolean.FALSE, formatterShowProperties);
-
- Boolean formatterShowNode = (Boolean) mbeanServer.getAttribute(on, "FormatterShowNode");
- assertEquals(Boolean.TRUE, formatterShowNode);
-
- Boolean formatterShowExchangePattern = (Boolean) mbeanServer.getAttribute(on, "FormatterShowExchangePattern");
- assertEquals(Boolean.TRUE, formatterShowExchangePattern);
-
- Boolean formatterShowException = (Boolean) mbeanServer.getAttribute(on, "FormatterShowException");
- assertEquals(Boolean.TRUE, formatterShowException);
-
- Boolean formatterShowShortExchangeId = (Boolean) mbeanServer.getAttribute(on, "FormatterShowShortExchangeId");
- assertEquals(Boolean.FALSE, formatterShowShortExchangeId);
-
- Integer formatterBreadCrumbLength = (Integer) mbeanServer.getAttribute(on, "FormatterBreadCrumbLength");
- assertEquals(0, formatterBreadCrumbLength.intValue());
-
- Integer formatterNodeLength = (Integer) mbeanServer.getAttribute(on, "FormatterNodeLength");
- assertEquals(0, formatterNodeLength.intValue());
-
- Integer formatterMaxChars = (Integer) mbeanServer.getAttribute(on, "FormatterMaxChars");
- assertEquals(10000, formatterMaxChars.intValue());
-
- // now disable tracing
- mbeanServer.setAttribute(camel, new Attribute("Tracing", Boolean.FALSE));
-
- // without tracing
- traced.reset();
- traced.setExpectedMessageCount(0);
- result.reset();
- result.setExpectedMessageCount(1);
-
- template.sendBody("direct:start", "Hello World");
-
- assertMockEndpointsSatisfied();
- }
-
- @Override
- protected RouteBuilder createRouteBuilder() throws Exception {
- return new RouteBuilder() {
- @Override
- public void configure() throws Exception {
- Tracer tracer = new Tracer();
- tracer.setDestinationUri("mock:traced");
- tracer.setLogLevel(LoggingLevel.OFF);
- context.addInterceptStrategy(tracer);
-
- from("direct:start").to("log:foo").to("mock:result");
- }
- };
- }
-
-}
\ No newline at end of file
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedRouteContextTracerTest.java b/camel-core/src/test/java/org/apache/camel/management/ManagedRouteContextTracerTest.java
deleted file mode 100644
index 180e328..0000000
--- a/camel-core/src/test/java/org/apache/camel/management/ManagedRouteContextTracerTest.java
+++ /dev/null
@@ -1,100 +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.management;
-
-import javax.management.Attribute;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
-import org.apache.camel.LoggingLevel;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.processor.interceptor.Tracer;
-import org.junit.Test;
-
-/**
- * @version
- */
-public class ManagedRouteContextTracerTest extends ManagementTestSupport {
-
- @Test
- public void testRouteTracing() throws Exception {
- // JMX tests dont work well on AIX CI servers (hangs them)
- if (isPlatform("aix")) {
- return;
- }
-
- MBeanServer mbeanServer = getMBeanServer();
-
- ObjectName on1 = ObjectName.getInstance("org.apache.camel:context=camel-1,type=routes,name=\"route1\"");
- ObjectName on2 = ObjectName.getInstance("org.apache.camel:context=camel-1,type=routes,name=\"route2\"");
-
- // with tracing
- MockEndpoint traced = getMockEndpoint("mock:traced");
- traced.setExpectedMessageCount(2);
- MockEndpoint result = getMockEndpoint("mock:result");
- result.setExpectedMessageCount(1);
- MockEndpoint foo = getMockEndpoint("mock:foo");
- foo.setExpectedMessageCount(1);
-
- template.sendBody("direct:start", "Hello World");
- template.sendBody("direct:foo", "Hello World");
-
- assertMockEndpointsSatisfied();
-
- // should be enabled for route 1
- Boolean tracing = (Boolean) mbeanServer.getAttribute(on1, "Tracing");
- assertEquals("Tracing should be enabled for route 1", true, tracing.booleanValue());
-
- // should be disabled for route 2
- Boolean tracing2 = (Boolean) mbeanServer.getAttribute(on2, "Tracing");
- assertEquals("Tracing should be disabled for route 2", false, tracing2.booleanValue());
-
- // now enable tracing on route 2
- mbeanServer.setAttribute(on2, new Attribute("Tracing", Boolean.TRUE));
-
- // with tracing
- traced.reset();
- traced.setExpectedMessageCount(1);
- result.reset();
- result.setExpectedMessageCount(0);
- foo.reset();
- foo.setExpectedMessageCount(1);
-
- template.sendBody("direct:foo", "Hello World");
-
- assertMockEndpointsSatisfied();
- }
-
- @Override
- protected RouteBuilder createRouteBuilder() throws Exception {
- return new RouteBuilder() {
- @Override
- public void configure() throws Exception {
- Tracer tracer = new Tracer();
- tracer.setDestinationUri("mock:traced");
- tracer.setLogLevel(LoggingLevel.OFF);
- context.addInterceptStrategy(tracer);
-
- from("direct:start").to("log:foo").to("mock:result");
-
- from("direct:foo").noTracing().to("mock:foo");
- }
- };
- }
-
-}
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedTracerOptionsTest.java b/camel-core/src/test/java/org/apache/camel/management/ManagedTracerOptionsTest.java
deleted file mode 100644
index 41e6896..0000000
--- a/camel-core/src/test/java/org/apache/camel/management/ManagedTracerOptionsTest.java
+++ /dev/null
@@ -1,177 +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.management;
-
-import javax.management.Attribute;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
-import org.apache.camel.LoggingLevel;
-import org.apache.camel.builder.RouteBuilder;
-import org.junit.Test;
-
-/**
- * @version
- */
-public class ManagedTracerOptionsTest extends ManagementTestSupport {
-
- @Test
- public void testManagedTracerOptions() throws Exception {
- // JMX tests dont work well on AIX CI servers (hangs them)
- if (isPlatform("aix")) {
- return;
- }
-
- MBeanServer mbeanServer = getMBeanServer();
-
- ObjectName on = new ObjectName("org.apache.camel:context=camel-1,type=tracer,name=Tracer");
- mbeanServer.isRegistered(on);
-
- mbeanServer.setAttribute(on, new Attribute("Enabled", Boolean.TRUE));
- Boolean enabled = (Boolean) mbeanServer.getAttribute(on, "Enabled");
- assertEquals(true, enabled.booleanValue());
-
- mbeanServer.setAttribute(on, new Attribute("DestinationUri", null));
- String duri = (String) mbeanServer.getAttribute(on, "DestinationUri");
- assertEquals(null, duri);
-
- mbeanServer.setAttribute(on, new Attribute("DestinationUri", "mock://traced"));
- duri = (String) mbeanServer.getAttribute(on, "DestinationUri");
- assertEquals("mock://traced", duri);
-
- Boolean useJpa = (Boolean) mbeanServer.getAttribute(on, "UseJpa");
- assertEquals(false, useJpa.booleanValue());
-
- mbeanServer.setAttribute(on, new Attribute("LogName", "foo"));
- String ln = (String) mbeanServer.getAttribute(on, "LogName");
- assertEquals("foo", ln);
-
- mbeanServer.setAttribute(on, new Attribute("LogLevel", "WARN"));
- String ll = (String) mbeanServer.getAttribute(on, "LogLevel");
- assertEquals(LoggingLevel.WARN.name(), ll);
-
- mbeanServer.setAttribute(on, new Attribute("LogStackTrace", Boolean.TRUE));
- Boolean lst = (Boolean) mbeanServer.getAttribute(on, "LogStackTrace");
- assertEquals(true, lst.booleanValue());
-
- mbeanServer.setAttribute(on, new Attribute("TraceInterceptors", Boolean.TRUE));
- Boolean ti = (Boolean) mbeanServer.getAttribute(on, "TraceInterceptors");
- assertEquals(true, ti.booleanValue());
-
- mbeanServer.setAttribute(on, new Attribute("TraceExceptions", Boolean.TRUE));
- Boolean te = (Boolean) mbeanServer.getAttribute(on, "TraceExceptions");
- assertEquals(true, te.booleanValue());
-
- mbeanServer.setAttribute(on, new Attribute("TraceOutExchanges", Boolean.TRUE));
- Boolean toe = (Boolean) mbeanServer.getAttribute(on, "TraceOutExchanges");
- assertEquals(true, toe.booleanValue());
-
- doAssertFormatter(mbeanServer, on);
-
- getMockEndpoint("mock:result").expectedMessageCount(1);
- template.sendBody("direct:start", "Hello World");
- assertMockEndpointsSatisfied();
- }
-
- private void doAssertFormatter(MBeanServer mbeanServer, ObjectName on) throws Exception {
- // JMX tests dont work well on AIX CI servers (hangs them)
- if (isPlatform("aix")) {
- return;
- }
-
- mbeanServer.setAttribute(on, new Attribute("FormatterShowBody", Boolean.TRUE));
- Boolean fsb = (Boolean) mbeanServer.getAttribute(on, "FormatterShowBody");
- assertEquals(true, fsb.booleanValue());
-
- mbeanServer.setAttribute(on, new Attribute("FormatterShowBodyType", Boolean.TRUE));
- Boolean fsbt = (Boolean) mbeanServer.getAttribute(on, "FormatterShowBodyType");
- assertEquals(true, fsbt.booleanValue());
-
- mbeanServer.setAttribute(on, new Attribute("FormatterShowOutBody", Boolean.TRUE));
- Boolean fsob = (Boolean) mbeanServer.getAttribute(on, "FormatterShowOutBody");
- assertEquals(true, fsob.booleanValue());
-
- mbeanServer.setAttribute(on, new Attribute("FormatterShowOutBodyType", Boolean.TRUE));
- Boolean fsobt = (Boolean) mbeanServer.getAttribute(on, "FormatterShowOutBodyType");
- assertEquals(true, fsobt.booleanValue());
-
- mbeanServer.setAttribute(on, new Attribute("FormatterShowBreadCrumb", Boolean.TRUE));
- Boolean fsbc = (Boolean) mbeanServer.getAttribute(on, "FormatterShowBreadCrumb");
- assertEquals(true, fsbc.booleanValue());
-
- mbeanServer.setAttribute(on, new Attribute("FormatterShowExchangeId", Boolean.TRUE));
- Boolean fsei = (Boolean) mbeanServer.getAttribute(on, "FormatterShowExchangeId");
- assertEquals(true, fsei.booleanValue());
-
- mbeanServer.setAttribute(on, new Attribute("FormatterShowShortExchangeId", Boolean.TRUE));
- Boolean fssei = (Boolean) mbeanServer.getAttribute(on, "FormatterShowShortExchangeId");
- assertEquals(true, fssei.booleanValue());
-
- mbeanServer.setAttribute(on, new Attribute("FormatterShowHeaders", Boolean.TRUE));
- Boolean fsh = (Boolean) mbeanServer.getAttribute(on, "FormatterShowHeaders");
- assertEquals(true, fsh.booleanValue());
-
- mbeanServer.setAttribute(on, new Attribute("FormatterShowOutHeaders", Boolean.TRUE));
- Boolean fsoh = (Boolean) mbeanServer.getAttribute(on, "FormatterShowOutHeaders");
- assertEquals(true, fsoh.booleanValue());
-
- mbeanServer.setAttribute(on, new Attribute("FormatterShowProperties", Boolean.TRUE));
- Boolean fsp = (Boolean) mbeanServer.getAttribute(on, "FormatterShowProperties");
- assertEquals(true, fsp.booleanValue());
-
- mbeanServer.setAttribute(on, new Attribute("FormatterShowNode", Boolean.TRUE));
- Boolean fsn = (Boolean) mbeanServer.getAttribute(on, "FormatterShowNode");
- assertEquals(true, fsn.booleanValue());
-
- mbeanServer.setAttribute(on, new Attribute("FormatterShowRouteId", Boolean.FALSE));
- Boolean fsr = (Boolean) mbeanServer.getAttribute(on, "FormatterShowRouteId");
- assertEquals(false, fsr.booleanValue());
-
- mbeanServer.setAttribute(on, new Attribute("FormatterShowExchangePattern", Boolean.TRUE));
- Boolean fsep = (Boolean) mbeanServer.getAttribute(on, "FormatterShowExchangePattern");
- assertEquals(true, fsep.booleanValue());
-
- mbeanServer.setAttribute(on, new Attribute("FormatterShowException", Boolean.TRUE));
- Boolean fsex = (Boolean) mbeanServer.getAttribute(on, "FormatterShowException");
- assertEquals(true, fsex.booleanValue());
-
- mbeanServer.setAttribute(on, new Attribute("FormatterBreadCrumbLength", 100));
- Integer fbcl = (Integer) mbeanServer.getAttribute(on, "FormatterBreadCrumbLength");
- assertEquals(100, fbcl.intValue());
-
- mbeanServer.setAttribute(on, new Attribute("FormatterNodeLength", 50));
- Integer fnl = (Integer) mbeanServer.getAttribute(on, "FormatterNodeLength");
- assertEquals(50, fnl.intValue());
-
- mbeanServer.setAttribute(on, new Attribute("FormatterMaxChars", 250));
- Integer fmc = (Integer) mbeanServer.getAttribute(on, "FormatterMaxChars");
- assertEquals(250, fmc.intValue());
- }
-
- @Override
- protected RouteBuilder createRouteBuilder() throws Exception {
- return new RouteBuilder() {
- @Override
- public void configure() throws Exception {
- context.setTracing(true);
-
- from("direct:start").to("mock:result");
- }
- };
- }
-
-}
\ No newline at end of file
diff --git a/camel-core/src/test/java/org/apache/camel/processor/DefaultErrorHandlerOnExceptionTraceTest.java b/camel-core/src/test/java/org/apache/camel/processor/DefaultErrorHandlerOnExceptionTraceTest.java
deleted file mode 100644
index e2d933f..0000000
--- a/camel-core/src/test/java/org/apache/camel/processor/DefaultErrorHandlerOnExceptionTraceTest.java
+++ /dev/null
@@ -1,117 +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.processor;
-
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.Exchange;
-import org.apache.camel.Processor;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.impl.JndiRegistry;
-import org.apache.camel.processor.interceptor.TraceEventMessage;
-import org.apache.camel.processor.interceptor.Tracer;
-import org.junit.Test;
-
-/**
- * Default error handler test with trace
- *
- * @version
- */
-public class DefaultErrorHandlerOnExceptionTraceTest extends ContextTestSupport {
-
- @Override
- protected JndiRegistry createRegistry() throws Exception {
- JndiRegistry jndi = super.createRegistry();
- jndi.bind("myProcessor", new MyProcessor());
- return jndi;
- }
-
- @Test
- public void testOk() throws Exception {
- MockEndpoint mock = getMockEndpoint("mock:result");
- mock.expectedBodiesReceived("Bye World");
- getMockEndpoint("mock:trace").expectedMessageCount(2);
-
- template.sendBody("direct:start", "Hello World");
-
- assertMockEndpointsSatisfied();
-
- TraceEventMessage msg1 = getMockEndpoint("mock:trace").getReceivedExchanges().get(0).getIn().getBody(TraceEventMessage.class);
- TraceEventMessage msg2 = getMockEndpoint("mock:trace").getReceivedExchanges().get(1).getIn().getBody(TraceEventMessage.class);
-
- assertEquals("direct://start", msg1.getFromEndpointUri());
- assertEquals("ref:myProcessor", msg1.getToNode());
-
- assertEquals("ref:myProcessor", msg2.getPreviousNode());
- assertEquals("mock://result", msg2.getToNode());
- }
-
- @Test
- public void testWithError() throws Exception {
- MockEndpoint mock = getMockEndpoint("mock:boom");
- mock.expectedMessageCount(1);
- getMockEndpoint("mock:trace").expectedMessageCount(4);
-
- template.sendBody("direct:start", "Kabom");
-
- assertMockEndpointsSatisfied();
-
- TraceEventMessage msg1 = getMockEndpoint("mock:trace").getReceivedExchanges().get(0).getIn().getBody(TraceEventMessage.class);
- TraceEventMessage msg2 = getMockEndpoint("mock:trace").getReceivedExchanges().get(1).getIn().getBody(TraceEventMessage.class);
- TraceEventMessage msg3 = getMockEndpoint("mock:trace").getReceivedExchanges().get(2).getIn().getBody(TraceEventMessage.class);
- TraceEventMessage msg4 = getMockEndpoint("mock:trace").getReceivedExchanges().get(3).getIn().getBody(TraceEventMessage.class);
-
- assertEquals("direct://start", msg1.getFromEndpointUri());
- assertEquals("ref:myProcessor", msg1.getToNode());
-
- assertEquals("ref:myProcessor", msg2.getPreviousNode());
- assertEquals("OnException[IllegalArgumentException]", msg2.getToNode());
-
- assertEquals("OnException[IllegalArgumentException]", msg3.getPreviousNode());
- assertEquals("log://boom", msg3.getToNode());
-
- assertEquals("log://boom", msg4.getPreviousNode());
- assertEquals("mock://boom", msg4.getToNode());
- }
-
- @Override
- protected RouteBuilder createRouteBuilder() throws Exception {
- return new RouteBuilder() {
- @Override
- public void configure() throws Exception {
- Tracer tracer = new Tracer();
- tracer.setDestinationUri("mock:trace");
- context.addInterceptStrategy(tracer);
-
- onException(IllegalArgumentException.class).handled(true).to("log:boom").to("mock:boom");
-
- from("direct:start").process("myProcessor").to("mock:result");
- }
- };
- }
-
- public static class MyProcessor implements Processor {
-
- public void process(Exchange exchange) throws Exception {
- String body = exchange.getIn().getBody(String.class);
- if ("Kabom".equals(body)) {
- throw new IllegalArgumentException("Boom");
- }
- exchange.getIn().setBody("Bye World");
- }
- }
-}
\ No newline at end of file
diff --git a/camel-core/src/test/java/org/apache/camel/processor/OnCompletionGlobalTraceTest.java b/camel-core/src/test/java/org/apache/camel/processor/OnCompletionGlobalTraceTest.java
deleted file mode 100644
index 3fbeb90..0000000
--- a/camel-core/src/test/java/org/apache/camel/processor/OnCompletionGlobalTraceTest.java
+++ /dev/null
@@ -1,138 +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.processor;
-
-import org.apache.camel.CamelExecutionException;
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.Exchange;
-import org.apache.camel.Processor;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.impl.JndiRegistry;
-import org.apache.camel.processor.interceptor.TraceEventMessage;
-import org.apache.camel.processor.interceptor.Tracer;
-import org.junit.Test;
-
-/**
- * @version
- */
-public class OnCompletionGlobalTraceTest extends ContextTestSupport {
-
- @Override
- protected JndiRegistry createRegistry() throws Exception {
- JndiRegistry jndi = super.createRegistry();
- jndi.bind("myProcessor", new MyProcessor());
- return jndi;
- }
-
- @Test
- public void testSynchronizeComplete() throws Exception {
- getMockEndpoint("mock:sync").expectedBodiesReceived("Bye World");
- getMockEndpoint("mock:sync").expectedPropertyReceived(Exchange.ON_COMPLETION, true);
- getMockEndpoint("mock:trace").expectedMessageCount(4);
-
- MockEndpoint mock = getMockEndpoint("mock:result");
- mock.expectedBodiesReceived("Bye World");
-
- template.sendBody("direct:start", "Hello World");
-
- assertMockEndpointsSatisfied();
-
- TraceEventMessage msg1 = getMockEndpoint("mock:trace").getReceivedExchanges().get(0).getIn().getBody(TraceEventMessage.class);
- TraceEventMessage msg2 = getMockEndpoint("mock:trace").getReceivedExchanges().get(1).getIn().getBody(TraceEventMessage.class);
- TraceEventMessage msg3 = getMockEndpoint("mock:trace").getReceivedExchanges().get(2).getIn().getBody(TraceEventMessage.class);
- TraceEventMessage msg4 = getMockEndpoint("mock:trace").getReceivedExchanges().get(3).getIn().getBody(TraceEventMessage.class);
-
- assertEquals("direct://start", msg1.getFromEndpointUri());
- assertEquals("ref:myProcessor", msg1.getToNode());
-
- assertEquals("ref:myProcessor", msg2.getPreviousNode());
- assertEquals("mock://result", msg2.getToNode());
-
- assertTrue(msg3.getPreviousNode().startsWith("OnCompletion"));
- assertEquals("log://global", msg3.getToNode());
-
- assertEquals("log://global", msg4.getPreviousNode());
- assertEquals("mock://sync", msg4.getToNode());
- }
-
- @Test
- public void testSynchronizeFailure() throws Exception {
- getMockEndpoint("mock:sync").expectedMessageCount(1);
- getMockEndpoint("mock:sync").expectedPropertyReceived(Exchange.ON_COMPLETION, true);
- getMockEndpoint("mock:trace").expectedMessageCount(3);
-
- MockEndpoint mock = getMockEndpoint("mock:result");
- mock.expectedMessageCount(0);
-
- try {
- template.sendBody("direct:start", "Kabom");
- fail("Should throw exception");
- } catch (CamelExecutionException e) {
- assertEquals("Kabom", e.getCause().getMessage());
- }
-
- assertMockEndpointsSatisfied();
-
- TraceEventMessage msg1 = getMockEndpoint("mock:trace").getReceivedExchanges().get(0).getIn().getBody(TraceEventMessage.class);
- TraceEventMessage msg2 = getMockEndpoint("mock:trace").getReceivedExchanges().get(1).getIn().getBody(TraceEventMessage.class);
- TraceEventMessage msg3 = getMockEndpoint("mock:trace").getReceivedExchanges().get(2).getIn().getBody(TraceEventMessage.class);
-
- assertEquals("direct://start", msg1.getFromEndpointUri());
- assertEquals("ref:myProcessor", msg1.getToNode());
-
- assertTrue(msg2.getPreviousNode().startsWith("OnCompletion"));
- assertEquals("log://global", msg2.getToNode());
-
- assertEquals("log://global", msg3.getPreviousNode());
- assertEquals("mock://sync", msg3.getToNode());
- }
-
- @Override
- protected RouteBuilder createRouteBuilder() throws Exception {
- return new RouteBuilder() {
- @Override
- public void configure() throws Exception {
- Tracer tracer = new Tracer();
- tracer.setDestinationUri("mock:trace");
- context.addInterceptStrategy(tracer);
-
- // START SNIPPET: e1
- // define a global on completion that is invoked when the exchange is complete
- onCompletion().to("log:global").to("mock:sync");
-
- from("direct:start")
- .process("myProcessor")
- .to("mock:result");
- // END SNIPPET: e1
- }
- };
- }
-
- public static class MyProcessor implements Processor {
-
- public MyProcessor() {
- }
-
- public void process(Exchange exchange) throws Exception {
- if ("Kabom".equals(exchange.getIn().getBody())) {
- throw new IllegalArgumentException("Kabom");
- }
- exchange.getIn().setBody("Bye World");
- }
- }
-}
\ No newline at end of file
diff --git a/camel-core/src/test/java/org/apache/camel/processor/RecipientListReturnValueTest.java b/camel-core/src/test/java/org/apache/camel/processor/RecipientListReturnValueTest.java
index 05d2617..b6ad743 100644
--- a/camel-core/src/test/java/org/apache/camel/processor/RecipientListReturnValueTest.java
+++ b/camel-core/src/test/java/org/apache/camel/processor/RecipientListReturnValueTest.java
@@ -20,7 +20,6 @@ import org.apache.camel.ContextTestSupport;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.impl.JndiRegistry;
-import org.apache.camel.processor.interceptor.Tracer;
import org.junit.Test;
/**
@@ -64,8 +63,6 @@ public class RecipientListReturnValueTest extends ContextTestSupport {
protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
public void configure() {
- getContext().addInterceptStrategy(new Tracer());
-
from("direct:beanRef").bean("myBean", "route");
from("direct:recipientList").recipientList().method("myBean", "recipientList");
diff --git a/camel-core/src/test/java/org/apache/camel/processor/TraceInterceptorWithOutBodyTraceTest.java b/camel-core/src/test/java/org/apache/camel/processor/TraceInterceptorWithOutBodyTraceTest.java
deleted file mode 100644
index aae1411..0000000
--- a/camel-core/src/test/java/org/apache/camel/processor/TraceInterceptorWithOutBodyTraceTest.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.processor;
-
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.processor.interceptor.DefaultTraceFormatter;
-import org.apache.camel.processor.interceptor.Tracer;
-
-public class TraceInterceptorWithOutBodyTraceTest extends TraceInterceptorTest {
-
- protected RouteBuilder createRouteBuilder() throws Exception {
- return new RouteBuilder() {
- public void configure() throws Exception {
- // START SNIPPET: tracingOutExchanges
- Tracer tracer = new Tracer();
- tracer.setTraceOutExchanges(true);
-
- // we configure the default trace formatter where we can
- // specify which fields we want in the output
- DefaultTraceFormatter formatter = new DefaultTraceFormatter();
- formatter.setShowOutBody(true);
- formatter.setShowOutBodyType(true);
-
- // set to use our formatter
- tracer.setFormatter(formatter);
-
- getContext().addInterceptStrategy(tracer);
- // END SNIPPET: tracingOutExchanges
-
- from("direct:start").
- transform().body().
- to("mock:a").
- to("mock:b");
- }
- };
- }
-
-}
diff --git a/camel-core/src/test/java/org/apache/camel/processor/TracePerRouteTest.java b/camel-core/src/test/java/org/apache/camel/processor/TracePerRouteTest.java
deleted file mode 100644
index f9edd79..0000000
--- a/camel-core/src/test/java/org/apache/camel/processor/TracePerRouteTest.java
+++ /dev/null
@@ -1,67 +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.processor;
-
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.processor.interceptor.Tracer;
-import org.junit.Test;
-
-/**
- * @version
- */
-public class TracePerRouteTest extends ContextTestSupport {
-
- @Test
- public void testTracingPerRoute() throws Exception {
- getMockEndpoint("mock:a").expectedMessageCount(1);
- getMockEndpoint("mock:b").expectedMessageCount(1);
- getMockEndpoint("mock:c").expectedMessageCount(1);
-
- // only a and c has enabled tracing
- MockEndpoint traced = getMockEndpoint("mock:traced");
- traced.expectedMessageCount(2);
- traced.message(0).body(String.class).contains("mock://a");
- traced.message(1).body(String.class).contains("mock://c");
-
- template.sendBody("direct:a", "Hello World");
- template.sendBody("direct:b", "Bye World");
- template.sendBody("direct:c", "Gooday World");
-
- assertMockEndpointsSatisfied();
- }
-
- @Override
- protected RouteBuilder createRouteBuilder() throws Exception {
- return new RouteBuilder() {
- @Override
- public void configure() throws Exception {
- Tracer tracer = new Tracer();
- tracer.setDestinationUri("mock:traced");
- tracer.setLogName("foo");
- context.addInterceptStrategy(tracer);
-
- from("direct:a").to("mock:a");
-
- from("direct:b").noTracing().to("mock:b");
-
- from("direct:c").tracing().to("mock:c");
- }
- };
- }
-}
diff --git a/camel-core/src/test/java/org/apache/camel/processor/TraceableUnitOfWorkTest.java b/camel-core/src/test/java/org/apache/camel/processor/TraceableUnitOfWorkTest.java
deleted file mode 100644
index 8096cf9..0000000
--- a/camel-core/src/test/java/org/apache/camel/processor/TraceableUnitOfWorkTest.java
+++ /dev/null
@@ -1,109 +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.processor;
-
-import java.util.List;
-
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.Exchange;
-import org.apache.camel.Processor;
-import org.apache.camel.RouteNode;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.impl.JndiRegistry;
-import org.apache.camel.management.InstrumentationProcessor;
-import org.apache.camel.spi.TracedRouteNodes;
-import org.junit.Test;
-
-/**
- * @version
- */
-public class TraceableUnitOfWorkTest extends ContextTestSupport {
-
- @Test
- public void testSendingSomeMessages() throws Exception {
- Object out = template.requestBody("direct:start", "Hello London");
- assertEquals("Failed at: sendTo(bean://bar)", out);
- }
-
- @Override
- protected JndiRegistry createRegistry() throws Exception {
- JndiRegistry jndi = super.createRegistry();
- jndi.bind("foo", new MyFooBean());
- jndi.bind("bar", new MyBarBean());
- return jndi;
- }
-
- // START SNIPPET: e1
- protected RouteBuilder createRouteBuilder() throws Exception {
- return new RouteBuilder() {
- public void configure() throws Exception {
- errorHandler(deadLetterChannel("mock:error").redeliveryDelay(0).maximumRedeliveries(3));
-
- // must enable tracer to trace the route path taken during runtime
- context.setTracing(true);
-
- // let our my error processor handle all exceptions
- onException(Exception.class).handled(true).process(new MyErrorProcessor());
-
- // our route where an exception can be thrown from either foo or bar bean
- // so we have enable tracing so we can check it at runtime to get the actual
- // node path taken
- from("direct:start").to("bean:foo").to("bean:bar");
- }
- };
- }
- // END SNIPPET: e1
-
- // START SNIPPET: e2
- private static class MyErrorProcessor implements Processor {
- public void process(Exchange exchange) throws Exception {
- TracedRouteNodes traced = exchange.getUnitOfWork().getTracedRouteNodes();
-
- // get the list of intercepted nodes
- List<RouteNode> list = traced.getNodes();
- // get the 3rd last as its the bean
- Processor last = list.get(list.size() - 3).getProcessor();
-
- // wrapped by JMX
- if (last instanceof InstrumentationProcessor) {
- InstrumentationProcessor ip = (InstrumentationProcessor) last;
- last = ip.getProcessor();
- }
-
- // set error message
- exchange.getOut().setFault(true);
- exchange.getOut().setBody("Failed at: " + last.toString());
- }
-
- public String toString() {
- return "MyErrorProcessor";
- }
- }
- // END SNIPPET: e2
-
- public class MyFooBean {
- public void process(Exchange exchange) throws Exception {
- exchange.getOut().setBody("Foo okay");
- }
- }
-
- public class MyBarBean {
- public void process(Exchange exchange) throws Exception {
- throw new IllegalArgumentException("Damm Bar");
- }
- }
-}
\ No newline at end of file
diff --git a/camel-core/src/test/java/org/apache/camel/processor/TracerConfigurationTest.java b/camel-core/src/test/java/org/apache/camel/processor/TracerConfigurationTest.java
index ba2123f..317f40a 100644
--- a/camel-core/src/test/java/org/apache/camel/processor/TracerConfigurationTest.java
+++ b/camel-core/src/test/java/org/apache/camel/processor/TracerConfigurationTest.java
@@ -17,10 +17,8 @@
package org.apache.camel.processor;
import org.apache.camel.ContextTestSupport;
-import org.apache.camel.LoggingLevel;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.processor.interceptor.Tracer;
import org.junit.Test;
/**
@@ -41,12 +39,6 @@ public class TracerConfigurationTest extends ContextTestSupport {
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
public void configure() throws Exception {
- Tracer tracer = new Tracer();
- tracer.setLogLevel(LoggingLevel.ERROR);
- tracer.setLogName("com.mycompany");
-
- getContext().addInterceptStrategy(tracer);
-
from("direct:start").to("mock:result");
}
};
diff --git a/camel-core/src/test/java/org/apache/camel/processor/async/AsyncTraceHandlerTest.java b/camel-core/src/test/java/org/apache/camel/processor/async/AsyncTraceHandlerTest.java
deleted file mode 100644
index 17482c1..0000000
--- a/camel-core/src/test/java/org/apache/camel/processor/async/AsyncTraceHandlerTest.java
+++ /dev/null
@@ -1,107 +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.processor.async;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.Exchange;
-import org.apache.camel.Processor;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.model.ProcessorDefinition;
-import org.apache.camel.processor.interceptor.TraceEventHandler;
-import org.apache.camel.processor.interceptor.TraceInterceptor;
-import org.apache.camel.processor.interceptor.Tracer;
-import org.junit.Ignore;
-import org.junit.Test;
-
-/**
- * @version
- */
-@Deprecated
-@Ignore
-public class AsyncTraceHandlerTest extends ContextTestSupport {
-
- private static String beforeThreadName;
- private static String afterThreadName;
-
- @Test
- public void testAsyncTraceHandler() throws Exception {
- getMockEndpoint("mock:result").expectedBodiesReceived("Bye Camel");
-
- String reply = template.requestBody("direct:start", "Hello Camel", String.class);
- assertEquals("Bye Camel", reply);
-
- assertMockEndpointsSatisfied();
-
- assertFalse("Should use different threads", beforeThreadName.equalsIgnoreCase(afterThreadName));
- }
-
- @Override
- protected CamelContext createCamelContext() throws Exception {
- CamelContext contextLocal = super.createCamelContext();
-
- Tracer tracer = (Tracer) contextLocal.getDefaultTracer();
- tracer.setEnabled(true);
- tracer.getTraceHandlers().clear();
- tracer.getTraceHandlers().add(new MyTraceHandler());
- tracer.setTraceOutExchanges(true);
-
- return contextLocal;
- }
-
- @Override
- protected RouteBuilder createRouteBuilder() throws Exception {
- return new RouteBuilder() {
- @Override
- public void configure() throws Exception {
- context.setTracing(true);
-
- context.addComponent("async", new MyAsyncComponent());
-
- from("direct:start")
- .tracing()
- .to("log:before")
- .to("async:bye:camel").id("async")
- .to("log:after")
- .to("mock:result");
- }
- };
- }
-
- private static class MyTraceHandler implements TraceEventHandler {
-
- @Override
- public void traceExchange(ProcessorDefinition<?> node, Processor target, TraceInterceptor traceInterceptor, Exchange exchange) throws Exception {
- // noop
- }
-
- @Override
- public Object traceExchangeIn(ProcessorDefinition<?> node, Processor target, TraceInterceptor traceInterceptor, Exchange exchange) throws Exception {
- if (node.getId().equals("async")) {
- beforeThreadName = Thread.currentThread().getName();
- }
- return null;
- }
-
- @Override
- public void traceExchangeOut(ProcessorDefinition<?> node, Processor target, TraceInterceptor traceInterceptor, Exchange exchange, Object traceState) throws Exception {
- if (node.getId().equals("async")) {
- afterThreadName = Thread.currentThread().getName();
- }
- }
- }
-}
\ No newline at end of file
diff --git a/camel-core/src/test/java/org/apache/camel/processor/intercept/InterceptSimpleRouteTraceTest.java b/camel-core/src/test/java/org/apache/camel/processor/intercept/InterceptSimpleRouteTraceTest.java
deleted file mode 100644
index 8cfd340..0000000
--- a/camel-core/src/test/java/org/apache/camel/processor/intercept/InterceptSimpleRouteTraceTest.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.processor.intercept;
-
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.processor.interceptor.TraceEventMessage;
-import org.apache.camel.processor.interceptor.Tracer;
-import org.junit.Test;
-
-/**
- * @version
- */
-public class InterceptSimpleRouteTraceTest extends ContextTestSupport {
-
- @Test
- public void testIntercept() throws Exception {
- getMockEndpoint("mock:foo").expectedMessageCount(1);
- getMockEndpoint("mock:bar").expectedMessageCount(1);
- getMockEndpoint("mock:result").expectedMessageCount(1);
-
- getMockEndpoint("mock:intercepted").expectedMessageCount(3);
- getMockEndpoint("mock:trace").expectedMessageCount(6);
-
- template.sendBody("direct:start", "Hello World");
-
- assertMockEndpointsSatisfied();
-
- TraceEventMessage msg1 = getMockEndpoint("mock:trace").getReceivedExchanges().get(0).getIn().getBody(TraceEventMessage.class);
- TraceEventMessage msg2 = getMockEndpoint("mock:trace").getReceivedExchanges().get(1).getIn().getBody(TraceEventMessage.class);
- TraceEventMessage msg3 = getMockEndpoint("mock:trace").getReceivedExchanges().get(2).getIn().getBody(TraceEventMessage.class);
- TraceEventMessage msg4 = getMockEndpoint("mock:trace").getReceivedExchanges().get(3).getIn().getBody(TraceEventMessage.class);
- TraceEventMessage msg5 = getMockEndpoint("mock:trace").getReceivedExchanges().get(4).getIn().getBody(TraceEventMessage.class);
- TraceEventMessage msg6 = getMockEndpoint("mock:trace").getReceivedExchanges().get(5).getIn().getBody(TraceEventMessage.class);
-
- assertEquals("direct://start", msg1.getFromEndpointUri());
- assertEquals("mock://intercepted", msg1.getToNode());
-
- assertEquals("mock://intercepted", msg2.getPreviousNode());
- assertEquals("mock://foo", msg2.getToNode());
-
- assertEquals("mock://foo", msg3.getPreviousNode());
- assertEquals("mock://intercepted", msg3.getToNode());
-
- assertEquals("mock://intercepted", msg4.getPreviousNode());
- assertEquals("mock://bar", msg4.getToNode());
-
- assertEquals("mock://bar", msg5.getPreviousNode());
- assertEquals("mock://intercepted", msg5.getToNode());
-
- assertEquals("mock://intercepted", msg6.getPreviousNode());
- assertEquals("mock://result", msg6.getToNode());
- }
-
- @Override
- protected RouteBuilder createRouteBuilder() throws Exception {
- return new RouteBuilder() {
- @Override
- public void configure() throws Exception {
- Tracer tracer = new Tracer();
- tracer.setDestinationUri("mock:trace");
- context.addInterceptStrategy(tracer);
-
- intercept().to("mock:intercepted");
-
- from("direct:start")
- .to("mock:foo").to("mock:bar").to("mock:result");
- }
- };
- }
-}
\ No newline at end of file
diff --git a/camel-core/src/test/java/org/apache/camel/processor/interceptor/DefaultTraceEventMessageCausedByExceptionTest.java b/camel-core/src/test/java/org/apache/camel/processor/interceptor/DefaultTraceEventMessageCausedByExceptionTest.java
deleted file mode 100644
index cf27000..0000000
--- a/camel-core/src/test/java/org/apache/camel/processor/interceptor/DefaultTraceEventMessageCausedByExceptionTest.java
+++ /dev/null
@@ -1,73 +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.processor.interceptor;
-
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.junit.Test;
-
-/**
- * @version
- */
-public class DefaultTraceEventMessageCausedByExceptionTest extends ContextTestSupport {
-
- @Test
- public void testCausedByException() throws Exception {
- getMockEndpoint("mock:handled").expectedMessageCount(1);
-
- MockEndpoint traced = getMockEndpoint("mock:traced");
- traced.expectedMessageCount(4);
-
- template.sendBody("direct:start", "Hello World");
-
- assertMockEndpointsSatisfied();
-
- DefaultTraceEventMessage em1 = traced.getReceivedExchanges().get(0).getIn().getBody(DefaultTraceEventMessage.class);
- DefaultTraceEventMessage em2 = traced.getReceivedExchanges().get(1).getIn().getBody(DefaultTraceEventMessage.class);
- DefaultTraceEventMessage em3 = traced.getReceivedExchanges().get(2).getIn().getBody(DefaultTraceEventMessage.class);
- DefaultTraceEventMessage em4 = traced.getReceivedExchanges().get(3).getIn().getBody(DefaultTraceEventMessage.class);
-
- assertNotNull(em1);
- assertNotNull(em2);
- assertNotNull(em3);
- assertNotNull(em4);
-
- assertNull(em1.getCausedByException());
- assertNull(em2.getCausedByException());
- assertEquals("java.lang.IllegalArgumentException: Forced", em3.getCausedByException());
- assertEquals("java.lang.IllegalArgumentException: Forced", em4.getCausedByException());
- }
-
- @Override
- protected RouteBuilder createRouteBuilder() throws Exception {
- return new RouteBuilder() {
- @Override
- public void configure() throws Exception {
- Tracer tracer = Tracer.createTracer(context);
- tracer.setDestinationUri("mock:traced");
- context.addInterceptStrategy(tracer);
-
- onException(Exception.class)
- .handled(true)
- .to("mock:handled");
-
- from("direct:start").to("mock:foo").throwException(new IllegalArgumentException("Forced"));
- }
- };
- }
-}
diff --git a/camel-core/src/test/java/org/apache/camel/processor/interceptor/DefaultTraceEventMessageTest.java b/camel-core/src/test/java/org/apache/camel/processor/interceptor/DefaultTraceEventMessageTest.java
deleted file mode 100644
index e3ae4ca..0000000
--- a/camel-core/src/test/java/org/apache/camel/processor/interceptor/DefaultTraceEventMessageTest.java
+++ /dev/null
@@ -1,156 +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.processor.interceptor;
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.util.Date;
-
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.Exchange;
-import org.apache.camel.ExchangePattern;
-import org.apache.camel.Processor;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.impl.DefaultExchange;
-import org.junit.Test;
-
-/**
- * @version
- */
-public class DefaultTraceEventMessageTest extends ContextTestSupport {
-
- @Test
- public void testDefaultTraceEventMessage() throws Exception {
- getMockEndpoint("mock:result").expectedMessageCount(1);
- MockEndpoint traced = getMockEndpoint("mock:traced");
- traced.expectedMessageCount(2);
-
- template.send("direct:start", new Processor() {
- public void process(Exchange exchange) throws Exception {
- exchange.setPattern(ExchangePattern.InOut);
- exchange.setProperty("foo", 123);
- exchange.getIn().setBody("Hello World");
- exchange.getIn().setHeader("bar", "456");
- exchange.getOut().setBody("Bye World");
- exchange.getOut().setHeader("cheese", 789);
- }
- });
-
- assertMockEndpointsSatisfied();
-
- DefaultTraceEventMessage em = traced.getReceivedExchanges().get(0).getIn().getBody(DefaultTraceEventMessage.class);
- assertNotNull(em);
- assertNotNull(em.getTimestamp());
- assertEquals("direct://start", em.getFromEndpointUri());
- assertEquals(null, em.getPreviousNode());
- assertEquals("mock://foo", em.getToNode());
- assertNotNull(em.getExchangeId());
- assertNotNull(em.getShortExchangeId());
- assertEquals("InOut", em.getExchangePattern());
- assertTrue(em.getProperties().contains("foo=123"));
- assertTrue(em.getProperties().contains("CamelToEndpoint=direct://start"));
- assertTrue(em.getProperties().contains("CamelCreatedTimestamp"));
- assertTrue(em.getHeaders().contains("bar=456"));
- assertEquals("Hello World", em.getBody());
- assertEquals("String", em.getBodyType());
- assertEquals("Bye World", em.getOutBody());
- assertEquals("String", em.getOutBodyType());
- assertEquals("{cheese=789}", em.getOutHeaders());
- }
-
- @Test
- public void testDefaultTraceEventMessageBody() throws Exception {
- Exchange exchange = new DefaultExchange(context);
- exchange.getIn().setBody(new File("target/test"));
- DefaultTraceEventMessage em = new DefaultTraceEventMessage(new Date(), null, exchange);
-
- assertEquals("Get a wrong body string", "[Body is file based: target" + File.separator + "test]", em.getBody());
-
- exchange.getIn().setBody(new ByteArrayInputStream("target/test".getBytes()));
- em = new DefaultTraceEventMessage(new Date(), null, exchange);
-
- assertEquals("Get a wrong body string", "[Body is instance of java.io.InputStream]", em.getBody());
- }
-
- @Test
- public void testDefaultTraceEventMessageOptions() throws Exception {
- Exchange exchange = new DefaultExchange(context);
- DefaultTraceEventMessage em = new DefaultTraceEventMessage(new Date(), null, exchange);
-
- em.setBody("Hello World");
- assertEquals("Hello World", em.getBody());
-
- em.setBodyType("String");
- assertEquals("String", em.getBodyType());
-
- em.setCausedByException("Damn");
- assertEquals("Damn", em.getCausedByException());
-
- em.setExchangeId("123");
- assertEquals("123", em.getExchangeId());
-
- em.setExchangePattern("InOnly");
- assertEquals("InOnly", em.getExchangePattern());
-
- em.setFromEndpointUri("direct://start");
- assertEquals("direct://start", em.getFromEndpointUri());
-
- em.setHeaders("{foo=123}");
- assertEquals("{foo=123}", em.getHeaders());
-
- em.setOutBody("123");
- assertEquals("123", em.getOutBody());
-
- em.setOutBodyType("Integer");
- assertEquals("Integer", em.getOutBodyType());
-
- em.setOutHeaders("{cheese=789}");
- assertEquals("{cheese=789}", em.getOutHeaders());
-
- em.setProperties("{foo=123}");
- assertEquals("{foo=123}", em.getProperties());
-
- em.setPreviousNode("A");
- assertEquals("A", em.getPreviousNode());
-
- em.setToNode("B");
- assertEquals("B", em.getToNode());
-
- em.setTimestamp(new Date());
- assertNotNull(em.getTimestamp());
-
- em.setShortExchangeId("123");
- assertEquals("123", em.getShortExchangeId());
-
- assertSame(exchange, em.getTracedExchange());
- }
-
- @Override
- protected RouteBuilder createRouteBuilder() throws Exception {
- return new RouteBuilder() {
- @Override
- public void configure() throws Exception {
- Tracer tracer = Tracer.createTracer(context);
- tracer.setDestinationUri("mock:traced");
- context.addInterceptStrategy(tracer);
-
- from("direct:start").to("mock:foo").to("mock:result");
- }
- };
- }
-}
diff --git a/camel-core/src/test/java/org/apache/camel/processor/interceptor/DefaultTraceFormatterTest.java b/camel-core/src/test/java/org/apache/camel/processor/interceptor/DefaultTraceFormatterTest.java
deleted file mode 100644
index e12f80c..0000000
--- a/camel-core/src/test/java/org/apache/camel/processor/interceptor/DefaultTraceFormatterTest.java
+++ /dev/null
@@ -1,170 +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.processor.interceptor;
-
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.Exchange;
-import org.apache.camel.Processor;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.junit.Test;
-
-/**
- * @version
- */
-public class DefaultTraceFormatterTest extends ContextTestSupport {
-
- @Test
- public void testDefaultTraceFormatter() {
- getFormatter();
- }
-
- @Test
- public void testFormat() throws Exception {
- Tracer tracer = new Tracer();
- tracer.setFormatter(getFormatter());
- context.addInterceptStrategy(tracer);
-
- MockEndpoint mock = getMockEndpoint("mock:result");
- mock.expectedMessageCount(1);
-
- template.send("direct:start", new Processor() {
- public void process(Exchange exchange) throws Exception {
- exchange.getIn().setBody("Hello World");
- exchange.getIn().setHeader("foo", 123);
- exchange.getOut().setBody("Bye World");
- exchange.getOut().setHeader("bar", 456);
- exchange.setProperty("quote", "Camel is cool");
- }
- });
-
- assertMockEndpointsSatisfied();
- }
-
- @Test
- public void testWithException() throws Exception {
- Tracer tracer = new Tracer();
- tracer.setFormatter(getFormatter());
- context.addInterceptStrategy(tracer);
-
- try {
- template.sendBody("direct:fail", "Hello World");
- fail("Should have thrown an exception");
- } catch (Exception e) {
- // ignore
- }
- }
-
- @Test
- public void testNoShow() throws Exception {
- DefaultTraceFormatter formatter = getFormatter();
- formatter.setShowBreadCrumb(false);
- formatter.setShowExchangeId(false);
- formatter.setShowShortExchangeId(false);
- formatter.setShowNode(false);
-
- Tracer tracer = new Tracer();
- tracer.setFormatter(formatter);
- context.addInterceptStrategy(tracer);
-
- MockEndpoint mock = getMockEndpoint("mock:result");
- mock.expectedMessageCount(1);
-
- template.sendBody("direct:start", "Hello World");
-
- assertMockEndpointsSatisfied();
- }
-
- @Override
- protected RouteBuilder createRouteBuilder() throws Exception {
- return new RouteBuilder() {
- @Override
- public void configure() throws Exception {
- from("direct:start").to("mock:result");
-
- from("direct:fail").to("mock:mid").throwException(new IllegalArgumentException("Damn"));
- }
- };
- }
-
- private DefaultTraceFormatter getFormatter() {
- DefaultTraceFormatter formatter = new DefaultTraceFormatter();
-
- formatter.setBreadCrumbLength(30);
- assertEquals(30, formatter.getBreadCrumbLength());
-
- formatter.setMaxChars(500);
- assertEquals(500, formatter.getMaxChars());
-
- formatter.setNodeLength(20);
- assertEquals(20, formatter.getNodeLength());
-
- formatter.setShowBody(true);
- assertEquals(true, formatter.isShowBody());
-
- formatter.setBreadCrumbLength(40);
- assertEquals(40, formatter.getBreadCrumbLength());
-
- formatter.setShowBody(true);
- assertEquals(true, formatter.isShowBody());
-
- formatter.setShowBodyType(true);
- assertEquals(true, formatter.isShowBodyType());
-
- formatter.setShowBreadCrumb(true);
- assertEquals(true, formatter.isShowBreadCrumb());
-
- formatter.setShowExchangeId(true);
- assertEquals(true, formatter.isShowExchangeId());
-
- formatter.setShowException(true);
- assertEquals(true, formatter.isShowException());
-
- formatter.setShowExchangePattern(true);
- assertEquals(true, formatter.isShowExchangePattern());
-
- formatter.setShowHeaders(true);
- assertEquals(true, formatter.isShowHeaders());
-
- formatter.setShowNode(true);
- assertEquals(true, formatter.isShowNode());
-
- formatter.setShowOutBody(true);
- assertEquals(true, formatter.isShowOutBody());
-
- formatter.setShowOutBodyType(true);
- assertEquals(true, formatter.isShowOutBodyType());
-
- formatter.setShowOutHeaders(true);
- assertEquals(true, formatter.isShowOutHeaders());
-
- formatter.setShowProperties(true);
- assertEquals(true, formatter.isShowProperties());
-
- formatter.setMultiline(true);
- assertEquals(true, formatter.isMultiline());
-
- formatter.setShowShortExchangeId(true);
- assertEquals(true, formatter.isShowShortExchangeId());
-
- formatter.setShowRouteId(false);
- assertEquals(false, formatter.isShowRouteId());
-
- return formatter;
- }
-
-}
diff --git a/camel-core/src/test/java/org/apache/camel/processor/interceptor/TraceFormatterTest.java b/camel-core/src/test/java/org/apache/camel/processor/interceptor/TraceFormatterTest.java
deleted file mode 100644
index b4dc8fe..0000000
--- a/camel-core/src/test/java/org/apache/camel/processor/interceptor/TraceFormatterTest.java
+++ /dev/null
@@ -1,122 +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.processor.interceptor;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.Exchange;
-import org.apache.camel.Processor;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.model.ProcessorDefinition;
-import org.junit.Test;
-
-/**
- * @version
- */
-public class TraceFormatterTest extends ContextTestSupport {
-
- private List<String> tracedBodies = new ArrayList<>();
-
- @Test
- public void testSendingSomeMessagesBeingTraced() throws Exception {
- MockEndpoint result = getMockEndpoint("mock:result");
- result.expectedBodiesReceived("Bye World");
-
- MockEndpoint mock = getMockEndpoint("mock:traced");
- mock.expectedMessageCount(4);
-
- template.sendBodyAndHeader("direct:start", "Hello London", "to", "James");
-
- assertMockEndpointsSatisfied();
-
- // assert we received the correct bodies at the given time of interception
- // and that the bodies haven't changed during the routing of the original
- // exchange that changes its body over time (Hello London -> Bye World)
- assertEquals("Hello London", tracedBodies.get(0));
- assertEquals("Hello World", tracedBodies.get(1));
- assertEquals("Goodday World", tracedBodies.get(2));
- assertEquals("Bye World", tracedBodies.get(3));
- }
-
- protected RouteBuilder createRouteBuilder() throws Exception {
- return new RouteBuilder() {
- public void configure() throws Exception {
- // START SNIPPET: e1
- // we create a tracer where we want to use our own formatter instead of the default one
- Tracer tracer = new Tracer();
-
- // use our own formatter instead of the default one
- MyTraceFormatter formatter = new MyTraceFormatter();
- tracer.setFormatter(formatter);
-
- // and we must remeber to add the tracer to Camel
- getContext().addInterceptStrategy(tracer);
- // END SNIPPET: e1
-
- // this is only for unit testing to use mock for assertion
- tracer.setDestinationUri("direct:traced");
-
- from("direct:start")
- .process(new MyProcessor("Hello World"))
- .process(new MyProcessor("Goodday World"))
- .process(new MyProcessor("Bye World"))
- .to("mock:result");
-
- from("direct:traced")
- .process(new MyTraveAssertProcessor())
- .to("mock:traced");
- }
- };
- }
-
- class MyProcessor implements Processor {
-
- private String msg;
-
- MyProcessor(String msg) {
- this.msg = msg;
- }
-
- public void process(Exchange exchange) throws Exception {
- exchange.getIn().setBody(msg);
- }
- }
-
- class MyTraveAssertProcessor implements Processor {
-
- public void process(Exchange exchange) throws Exception {
- // take a snapshot at current time for assertion later
- // after mock assertions in unit test method
- TraceEventMessage event = exchange.getIn().getBody(DefaultTraceEventMessage.class);
- tracedBodies.add(new String(event.getBody()));
- }
- }
-
- // START SNIPPET: e2
- // here we have out own formatter where we can create the output we want for trace logs
- // as this is a test we just create a simple string with * around the body
- class MyTraceFormatter implements TraceFormatter {
-
- public Object format(TraceInterceptor interceptor, ProcessorDefinition<?> node, Exchange exchange) {
- return "***" + exchange.getIn().getBody(String.class) + "***";
- }
- }
- // END SNIPPET: e2
-}
\ No newline at end of file
diff --git a/camel-core/src/test/java/org/apache/camel/processor/interceptor/TraceHandlerTest.java b/camel-core/src/test/java/org/apache/camel/processor/interceptor/TraceHandlerTest.java
deleted file mode 100644
index 5ba438f..0000000
--- a/camel-core/src/test/java/org/apache/camel/processor/interceptor/TraceHandlerTest.java
+++ /dev/null
@@ -1,62 +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.processor.interceptor;
-
-import java.util.LinkedList;
-
-import org.apache.camel.CamelContext;
-
-public class TraceHandlerTest extends TracingTestBase {
-
- @Override
- protected CamelContext createCamelContext() throws Exception {
- CamelContext contextLocal = super.createCamelContext();
-
- tracedMessages = new LinkedList<>();
-
- Tracer tracer = (Tracer) contextLocal.getDefaultTracer();
- tracer.setEnabled(true);
- tracer.setTraceExceptions(true);
- tracer.getTraceHandlers().clear();
- tracer.getTraceHandlers().add(new TraceHandlerTestHandler(tracedMessages));
-
- return contextLocal;
- }
-
- protected void validateTestTracerInOnly() {
- assertEquals(6, tracedMessages.size());
- for (StringBuilder tracedMessage : tracedMessages) {
- String message = tracedMessage.toString();
- assertTrue(message.startsWith("Complete:"));
- }
- }
-
- protected void validateTestTracerInOut() {
- assertEquals(6, tracedMessages.size());
- for (StringBuilder tracedMessage : tracedMessages) {
- String message = tracedMessage.toString();
- assertTrue(message.startsWith("In:"));
- assertTrue(message.contains("Out:"));
- }
- }
-
- @Override
- protected void prepareTestTracerExceptionInOut() {
- ((TraceHandlerTestHandler) ((Tracer) context.getDefaultTracer()).getTraceHandlers().get(0)).setTraceAllNodes(true);
- }
-
-}
diff --git a/camel-core/src/test/java/org/apache/camel/processor/interceptor/TraceHandlerTestHandler.java b/camel-core/src/test/java/org/apache/camel/processor/interceptor/TraceHandlerTestHandler.java
deleted file mode 100644
index be4659e..0000000
--- a/camel-core/src/test/java/org/apache/camel/processor/interceptor/TraceHandlerTestHandler.java
+++ /dev/null
@@ -1,113 +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.processor.interceptor;
-
-import java.util.LinkedList;
-import java.util.List;
-
-import org.apache.camel.Exchange;
-import org.apache.camel.Processor;
-import org.apache.camel.model.ProcessorDefinition;
-
-public class TraceHandlerTestHandler implements TraceEventHandler {
- private List<StringBuilder> eventMessages;
- private boolean traceAllNodes;
-
- public TraceHandlerTestHandler() {
- this.eventMessages = new LinkedList<>();
- this.traceAllNodes = false;
- }
-
- public TraceHandlerTestHandler(List<StringBuilder> eventMessages) {
- this.eventMessages = eventMessages;
- this.traceAllNodes = false;
- }
-
- public List<StringBuilder> getEventMessages() {
- return eventMessages;
- }
-
- public void setEventMessages(List<StringBuilder> eventMessages) {
- this.eventMessages = eventMessages;
- }
-
- public boolean isTraceAllNodes() {
- return traceAllNodes;
- }
-
- public void setTraceAllNodes(boolean traceAllNodes) {
- this.traceAllNodes = traceAllNodes;
- }
-
- private synchronized void storeMessage(StringBuilder message) {
- eventMessages.add(message);
- }
-
- public static void recordComplete(StringBuilder message, ProcessorDefinition<?> node, Exchange exchange) {
- message.append("Complete: ");
- message.append(node.getLabel() + ": ");
- message.append(exchange.getIn().getBody());
- }
-
- public static void recordIn(StringBuilder message, ProcessorDefinition<?> node, Exchange exchange) {
- message.append("In: ");
- message.append(node.getLabel() + ": ");
- message.append(exchange.getIn().getBody());
- }
-
- public static void recordOut(StringBuilder message, ProcessorDefinition<?> node, Exchange exchange) {
- message.append("Out: ");
- message.append(node.getLabel() + ": ");
- if (null != exchange.getOut()) {
- message.append(exchange.getOut().getBody());
- }
- if (null != exchange.getException()) {
- Exception ex = exchange.getException();
- message.append("\t");
- message.append("Ex: ");
- message.append(ex.getMessage());
- }
- }
-
- public void traceExchange(ProcessorDefinition<?> node, Processor target, TraceInterceptor traceInterceptor, Exchange exchange) throws Exception {
- if (traceAllNodes || !node.getLabel().contains("TraceTestProcessor")) {
- StringBuilder message = new StringBuilder();
- recordComplete(message, node, exchange);
- storeMessage(message);
- }
- }
-
- public Object traceExchangeIn(ProcessorDefinition<?> node, Processor target, TraceInterceptor traceInterceptor, Exchange exchange) throws Exception {
- if (traceAllNodes || !node.getLabel().contains("TraceTestProcessor")) {
- StringBuilder message = new StringBuilder();
- recordIn(message, node, exchange);
- return message;
- } else {
- return null;
- }
- }
-
- public void traceExchangeOut(ProcessorDefinition<?> node, Processor target, TraceInterceptor traceInterceptor, Exchange exchange, Object traceState) throws Exception {
- if (traceAllNodes || !node.getLabel().contains("TraceTestProcessor")) {
- if (StringBuilder.class.equals(traceState.getClass())) {
- StringBuilder message = (StringBuilder) traceState;
- recordOut(message, node, exchange);
- storeMessage(message);
- }
- }
- }
-}
diff --git a/camel-core/src/test/java/org/apache/camel/processor/interceptor/TraceInitIdOnAllNodesTest.java b/camel-core/src/test/java/org/apache/camel/processor/interceptor/TraceInitIdOnAllNodesTest.java
deleted file mode 100644
index 1f4c7ec..0000000
--- a/camel-core/src/test/java/org/apache/camel/processor/interceptor/TraceInitIdOnAllNodesTest.java
+++ /dev/null
@@ -1,99 +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.processor.interceptor;
-
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.model.ChoiceDefinition;
-import org.apache.camel.model.LogDefinition;
-import org.apache.camel.model.OtherwiseDefinition;
-import org.apache.camel.model.RouteDefinition;
-import org.apache.camel.model.ToDefinition;
-import org.apache.camel.model.WhenDefinition;
-import org.junit.Test;
-
-/**
- * Tests that when tracing is enabled the ids of all the nodes is forced assigned
- * to ensure the tracer outputs node id for each node in the tracing messages.
- */
-public class TraceInitIdOnAllNodesTest extends ContextTestSupport {
-
- @Test
- public void testInitIdsOnAllNodes() throws Exception {
- getMockEndpoint("mock:camel").expectedBodiesReceived("Hello Camel");
- getMockEndpoint("mock:other").expectedBodiesReceived("Hello World");
- getMockEndpoint("mock:end").expectedMessageCount(2);
-
- template.sendBody("direct:start", "Hello Camel");
- template.sendBody("direct:start", "Hello World");
-
- assertMockEndpointsSatisfied();
-
- RouteDefinition route = context.getRouteDefinitions().get(0);
- assertNotNull(route);
-
- ChoiceDefinition choice = (ChoiceDefinition) route.getOutputs().get(0);
- assertEquals("choice1", choice.getId());
-
- WhenDefinition when = (WhenDefinition) choice.getOutputs().get(0);
- assertEquals("when1", when.getId());
-
- LogDefinition log1 = (LogDefinition) when.getOutputs().get(0);
- assertEquals("log1", log1.getId());
-
- ToDefinition to1 = (ToDefinition) when.getOutputs().get(1);
- assertEquals("camel", to1.getId());
-
- OtherwiseDefinition other = (OtherwiseDefinition) choice.getOutputs().get(1);
- assertEquals("otherwise1", other.getId());
-
- LogDefinition log2 = (LogDefinition) other.getOutputs().get(0);
- assertEquals("log2", log2.getId());
-
- ToDefinition to2 = (ToDefinition) other.getOutputs().get(1);
- assertEquals("to1", to2.getId());
-
- ToDefinition to3 = (ToDefinition) other.getOutputs().get(2);
- assertEquals("foo", to3.getId());
-
- ToDefinition to4 = (ToDefinition) route.getOutputs().get(1);
- assertEquals("end", to4.getId());
- }
-
- @Override
- protected RouteBuilder createRouteBuilder() throws Exception {
- return new RouteBuilder() {
- @Override
- public void configure() throws Exception {
- // when tracing is enabled, then the ids is force assigned
- context.setTracing(true);
-
- from("direct:start")
- .choice()
- .when(body().contains("Camel"))
- .log("A Camel message")
- .to("mock:camel").id("camel")
- .otherwise()
- .log("Some other kind of message")
- .to("mock:other") // should auto generate id
- .to("mock:foo").id("foo")
- .end()
- .to("mock:end").id("end");
- }
- };
- }
-}
diff --git a/camel-core/src/test/java/org/apache/camel/processor/interceptor/TraceInterceptorCustomJpaMessage.java b/camel-core/src/test/java/org/apache/camel/processor/interceptor/TraceInterceptorCustomJpaMessage.java
deleted file mode 100644
index df2f169..0000000
--- a/camel-core/src/test/java/org/apache/camel/processor/interceptor/TraceInterceptorCustomJpaMessage.java
+++ /dev/null
@@ -1,191 +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.processor.interceptor;
-
-import java.util.Date;
-
-import org.apache.camel.Exchange;
-
-public class TraceInterceptorCustomJpaMessage implements TraceEventMessage {
-
- protected Long id;
- protected Date timestamp;
- protected String fromEndpointUri;
- protected String previousNode;
- protected String toNode;
- protected String exchangeId;
- protected String routeId;
- protected String shortExchangeId;
- protected String exchangePattern;
- protected String properties;
- protected String headers;
- protected String body;
- protected String bodyType;
- protected String outHeaders;
- protected String outBody;
- protected String outBodyType;
- protected String causedByException;
-
- public TraceInterceptorCustomJpaMessage() {
- }
-
- public Long getId() {
- return id;
- }
-
- public void setId(Long id) {
- this.id = id;
- }
-
- public Date getTimestamp() {
- return timestamp;
- }
-
- public void setTimestamp(Date timestamp) {
- this.timestamp = timestamp;
- }
-
- public String getPreviousNode() {
- return previousNode;
- }
-
- public void setPreviousNode(String previousNode) {
- this.previousNode = previousNode;
- }
-
- public String getFromEndpointUri() {
- return fromEndpointUri;
- }
-
- public void setFromEndpointUri(String fromEndpointUri) {
- this.fromEndpointUri = fromEndpointUri;
- }
-
- public String getToNode() {
- return toNode;
- }
-
- public void setToNode(String toNode) {
- this.toNode = toNode;
- }
-
- public String getExchangeId() {
- return exchangeId;
- }
-
- public void setExchangeId(String exchangeId) {
- this.exchangeId = exchangeId;
- }
-
- public String getRouteId() {
- return routeId;
- }
-
- public void setRouteId(String routeId) {
- this.routeId = routeId;
- }
-
- public String getShortExchangeId() {
- return shortExchangeId;
- }
-
- public void setShortExchangeId(String shortExchangeId) {
- this.shortExchangeId = shortExchangeId;
- }
-
- public String getExchangePattern() {
- return exchangePattern;
- }
-
- public void setExchangePattern(String exchangePattern) {
- this.exchangePattern = exchangePattern;
- }
-
- public String getProperties() {
- return properties;
- }
-
- public void setProperties(String properties) {
- this.properties = properties;
- }
-
- public String getHeaders() {
- return headers;
- }
-
- public void setHeaders(String headers) {
- this.headers = headers;
- }
-
- public String getBody() {
- return body;
- }
-
- public void setBody(String body) {
- this.body = body;
- }
-
- public String getBodyType() {
- return bodyType;
- }
-
- public void setBodyType(String bodyType) {
- this.bodyType = bodyType;
- }
-
- public String getOutBody() {
- return outBody;
- }
-
- public void setOutBody(String outBody) {
- this.outBody = outBody;
- }
-
- public String getOutBodyType() {
- return outBodyType;
- }
-
- public void setOutBodyType(String outBodyType) {
- this.outBodyType = outBodyType;
- }
-
- public String getOutHeaders() {
- return outHeaders;
- }
-
- public void setOutHeaders(String outHeaders) {
- this.outHeaders = outHeaders;
- }
-
- public String getCausedByException() {
- return causedByException;
- }
-
- public void setCausedByException(String causedByException) {
- this.causedByException = causedByException;
- }
-
- public Exchange getTracedExchange() {
- return null;
- }
-
- @Override
- public String toString() {
- return "TraceInterceptorCustomJpaMessage[" + getExchangeId() + "] on node: " + getToNode();
- }
-
-}
diff --git a/camel-core/src/test/java/org/apache/camel/processor/interceptor/TraceInterceptorCustomJpaMessageTest.java b/camel-core/src/test/java/org/apache/camel/processor/interceptor/TraceInterceptorCustomJpaMessageTest.java
deleted file mode 100644
index c3530dd..0000000
--- a/camel-core/src/test/java/org/apache/camel/processor/interceptor/TraceInterceptorCustomJpaMessageTest.java
+++ /dev/null
@@ -1,91 +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.processor.interceptor;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.Exchange;
-import org.apache.camel.component.mock.MockEndpoint;
-
-public class TraceInterceptorCustomJpaMessageTest extends TracingTestBase {
-
- @Override
- protected CamelContext createCamelContext() throws Exception {
- CamelContext contextLocal = super.createCamelContext();
-
- Tracer tracer = (Tracer) contextLocal.getDefaultTracer();
- tracer.setEnabled(true);
- tracer.setTraceExceptions(true);
- tracer.setUseJpa(true);
- tracer.setDestinationUri("mock:jpa-trace");
- tracer.setJpaTraceEventMessageClassName("org.apache.camel.processor.interceptor.TraceInterceptorCustomJpaMessage");
-
- return contextLocal;
- }
-
- @Override
- protected void prepareTestTracerInOnly() {
- MockEndpoint traces = getMockEndpoint("mock:jpa-trace");
- traces.expectedMessageCount(6);
- }
-
- @Override
- protected void prepareTestTracerInOut() {
- MockEndpoint traces = getMockEndpoint("mock:jpa-trace");
- traces.expectedMessageCount(12);
- }
-
- @Override
- protected void prepareTestTracerExceptionInOut() {
- MockEndpoint traces = getMockEndpoint("mock:jpa-trace");
- traces.expectedMessageCount(10);
- }
-
- @Override
- protected void validateTestTracerInOnly() {
- MockEndpoint traces = getMockEndpoint("mock:jpa-trace");
- assertEquals(6, traces.getExchanges().size());
- for (Exchange exchange : traces.getExchanges()) {
- assertEquals(exchange.getIn().getBody().getClass(), TraceInterceptorCustomJpaMessage.class);
- }
- }
-
- @Override
- protected void validateTestTracerInOut() {
- MockEndpoint traces = getMockEndpoint("mock:jpa-trace");
- assertEquals(12, traces.getExchanges().size());
- for (Exchange exchange : traces.getExchanges()) {
- assertEquals(exchange.getIn().getBody().getClass(), TraceInterceptorCustomJpaMessage.class);
- }
- }
-
- @Override
- protected void validateTestTracerExceptionInOut() {
- MockEndpoint traces = getMockEndpoint("mock:jpa-trace");
- assertEquals(10, traces.getExchanges().size());
- for (Exchange exchange : traces.getExchanges()) {
- assertEquals(exchange.getIn().getBody().getClass(), TraceInterceptorCustomJpaMessage.class);
- }
- }
-
- @Override
- protected int getMessageCount() {
- MockEndpoint traces = getMockEndpoint("mock:jpa-trace");
- return traces.getExchanges().size();
- }
-
-
-}
diff --git a/camel-core/src/test/java/org/apache/camel/processor/interceptor/TraceInterceptorDestinationTest.java b/camel-core/src/test/java/org/apache/camel/processor/interceptor/TraceInterceptorDestinationTest.java
deleted file mode 100644
index 2da49ac..0000000
--- a/camel-core/src/test/java/org/apache/camel/processor/interceptor/TraceInterceptorDestinationTest.java
+++ /dev/null
@@ -1,163 +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.processor.interceptor;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.Exchange;
-import org.apache.camel.LoggingLevel;
-import org.apache.camel.Processor;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.junit.Test;
-
-/**
- * @version
- */
-public class TraceInterceptorDestinationTest extends ContextTestSupport {
-
- private List<String> tracedBodies = new ArrayList<>();
- private List<String> tracedHeaders = new ArrayList<>();
-
- @Test
- public void testSendingSomeMessagesBeingTraced() throws Exception {
- MockEndpoint result = getMockEndpoint("mock:result");
- result.expectedBodiesReceived("Bye World", "Foo World", "Foo World");
-
- MockEndpoint mock = getMockEndpoint("mock:traced");
- mock.expectedMessageCount(8);
- // should be in our CSV format (defined in bottom of this class)
- mock.message(0).body().regex("^direct://start;.*;.*;Hello London");
- mock.message(1).body().regex("^direct://start;.*;.*;Hello World");
- mock.message(2).body().regex("^direct://start;.*;.*;Goodday World");
- mock.message(3).body().regex("^direct://start;.*;.*;Bye World");
- mock.message(4).body().regex("^direct://foo;.*;.*;Hello Copenhagen");
- mock.message(5).body().regex("^direct://foo;.*;.*;Foo World");
- mock.message(6).body().regex("^direct://foo;.*;.*;Hello Beijing");
- mock.message(7).body().regex("^direct://foo;.*;.*;Foo World");
-
- template.sendBodyAndHeader("direct:start", "Hello London", "to", "James");
- template.sendBody("direct:foo", "Hello Copenhagen");
- // to test sending to same endpoint twice
- template.sendBody("direct:foo", "Hello Beijing");
-
- assertMockEndpointsSatisfied();
-
- // assert we received the correct bodies at the given time of interception
- // and that the bodies haven't changed during the routing of the original
- // exchange that changes its body over time (Hello London -> Bye World)
- assertEquals("Hello London", tracedBodies.get(0));
- assertEquals("Hello World", tracedBodies.get(1));
- assertEquals("Goodday World", tracedBodies.get(2));
- assertEquals("Bye World", tracedBodies.get(3));
- assertEquals("Hello Copenhagen", tracedBodies.get(4));
- assertEquals("Foo World", tracedBodies.get(5));
- assertEquals("Hello Beijing", tracedBodies.get(6));
- assertEquals("Foo World", tracedBodies.get(7));
-
- // assert headers as well
- assertTrue(tracedHeaders.get(0), tracedHeaders.get(0).contains("to=James"));
- assertTrue(tracedHeaders.get(1), tracedHeaders.get(1).contains("to=Hello"));
- assertTrue(tracedHeaders.get(2), tracedHeaders.get(2).contains("to=Goodday"));
- assertTrue(tracedHeaders.get(3), tracedHeaders.get(3).contains("to=Bye"));
- }
-
- protected RouteBuilder createRouteBuilder() throws Exception {
- return new RouteBuilder() {
- public void configure() throws Exception {
- // START SNIPPET: e1
- // we create a tracer where we want to send TraveEvents to an endpoint
- // "direct:traced" where we can do some custom processing such as storing
- // it in a file or a database
- Tracer tracer = new Tracer();
- tracer.setDestinationUri("direct:traced");
- // we disable regular trace logging in the log file. You can omit this and
- // have both.
- tracer.setLogLevel(LoggingLevel.OFF);
- // and we must remember to add the tracer to Camel
- getContext().addInterceptStrategy(tracer);
- // END SNIPPET: e1
-
- from("direct:start")
- .process(new MyProcessor("Hello World"))
- .process(new MyProcessor("Goodday World"))
- .process(new MyProcessor("Bye World"))
- .to("mock:result");
-
- from("direct:foo")
- .process(new MyProcessor("Foo World"))
- .to("mock:result");
-
- from("direct:traced")
- .process(new MyTraveAssertProcessor())
- .process(new MyTraceMessageProcessor())
- .to("mock:traced");
- }
- };
- }
-
- class MyProcessor implements Processor {
-
- private String msg;
-
- MyProcessor(String msg) {
- this.msg = msg;
- }
-
- public void process(Exchange exchange) throws Exception {
- exchange.getIn().setBody(msg);
- exchange.getIn().setHeader("to", msg.split(" ")[0]);
- }
- }
-
- class MyTraveAssertProcessor implements Processor {
-
- public void process(Exchange exchange) throws Exception {
- String nodeId = exchange.getProperty(Exchange.TRACE_EVENT_NODE_ID, String.class);
- Date timestamp = exchange.getProperty(Exchange.TRACE_EVENT_TIMESTAMP, Date.class);
- assertNotNull(nodeId);
- assertNotNull(timestamp);
-
- // take a snapshot at current time for assertion later
- // after mock assertions in unit test method
- TraceEventMessage msg = exchange.getIn().getBody(DefaultTraceEventMessage.class);
- tracedBodies.add(msg.getBody());
- if (msg.getHeaders() != null) {
- tracedHeaders.add(msg.getHeaders());
- }
- }
- }
-
- // START SNIPPET: e2
- class MyTraceMessageProcessor implements Processor {
-
- public void process(Exchange exchange) throws Exception {
- // here we can transform the message how we like want it
- TraceEventMessage msg = exchange.getIn().getBody(DefaultTraceEventMessage.class);
-
- // we want to store it as a CSV with from;to;exchangeId;body
- String s = msg.getFromEndpointUri() + ";" + msg.getToNode() + ";" + msg.getExchangeId() + ";" + msg.getBody();
-
- // so we replace the IN body with our CSV string
- exchange.getIn().setBody(s);
- }
- }
- // END SNIPPET: e2
-}
\ No newline at end of file
diff --git a/camel-core/src/test/java/org/apache/camel/processor/interceptor/TraceInterceptorFactoryCreatesHandlerTest.java b/camel-core/src/test/java/org/apache/camel/processor/interceptor/TraceInterceptorFactoryCreatesHandlerTest.java
deleted file mode 100644
index ff73fd2..0000000
--- a/camel-core/src/test/java/org/apache/camel/processor/interceptor/TraceInterceptorFactoryCreatesHandlerTest.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.processor.interceptor;
-
-import java.util.LinkedList;
-import java.util.List;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.DelegateProcessor;
-import org.apache.camel.Processor;
-import org.apache.camel.model.ProcessorDefinition;
-
-public class TraceInterceptorFactoryCreatesHandlerTest extends TracingTestBase {
-
- private static class TraceInterceptorFactoryCreatesHandlerTestFactory implements TraceInterceptorFactory {
- private List<StringBuilder> eventMessages;
- private boolean traceAllNodes;
-
- TraceInterceptorFactoryCreatesHandlerTestFactory(List<StringBuilder> eventMessages, boolean traceAllNodes) {
- this.eventMessages = eventMessages;
- this.traceAllNodes = traceAllNodes;
- }
-
- @SuppressWarnings("deprecation")
- public Processor createTraceInterceptor(ProcessorDefinition<?> node, Processor target, TraceFormatter formatter, Tracer tracer) {
-
- TraceInterceptor interceptor = new TraceInterceptor(node, target, formatter, tracer);
-
- while (target instanceof DelegateProcessor) {
- target = ((DelegateProcessor) target).getProcessor();
- }
- if (traceAllNodes || !target.getClass().equals(TraceTestProcessor.class)) {
- TraceHandlerTestHandler traceHandler = new TraceHandlerTestHandler(eventMessages);
- traceHandler.setTraceAllNodes(true);
- interceptor.setTraceHandler(traceHandler);
- }
-
- return interceptor;
- }
- }
-
- @Override
- protected CamelContext createCamelContext() throws Exception {
- CamelContext contextLocal = super.createCamelContext();
-
- tracedMessages = new LinkedList<>();
-
- Tracer tracer = (Tracer) contextLocal.getDefaultTracer();
- tracer.setEnabled(true);
- tracer.setTraceExceptions(true);
- if ("testTracerExceptionInOut".equals(getName())) {
- tracer.setTraceInterceptorFactory(new TraceInterceptorFactoryCreatesHandlerTestFactory(tracedMessages, true));
- } else {
- tracer.setTraceInterceptorFactory(new TraceInterceptorFactoryCreatesHandlerTestFactory(tracedMessages, false));
- }
-
- return contextLocal;
- }
-
-}
diff --git a/camel-core/src/test/java/org/apache/camel/processor/interceptor/TraceInterceptorSubclassFactory.java b/camel-core/src/test/java/org/apache/camel/processor/interceptor/TraceInterceptorSubclassFactory.java
deleted file mode 100644
index 2cdfec0..0000000
--- a/camel-core/src/test/java/org/apache/camel/processor/interceptor/TraceInterceptorSubclassFactory.java
+++ /dev/null
@@ -1,100 +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.processor.interceptor;
-
-import java.util.List;
-
-import org.apache.camel.DelegateProcessor;
-import org.apache.camel.Exchange;
-import org.apache.camel.Processor;
-import org.apache.camel.model.ProcessorDefinition;
-
-public class TraceInterceptorSubclassFactory implements TraceInterceptorFactory {
- private List<StringBuilder> eventMessages;
- private boolean traceAllNodes;
-
- public TraceInterceptorSubclassFactory(List<StringBuilder> eventMessages) {
- this.eventMessages = eventMessages;
- }
-
- public TraceInterceptor createTraceInterceptor(ProcessorDefinition<?> node, Processor target, TraceFormatter formatter, Tracer tracer) {
- return new TracerInterceptorSubclass(node, target, formatter, tracer, eventMessages, this);
- }
-
- public boolean getTraceAllNodes() {
- return traceAllNodes;
- }
-
- public void setTraceAllNodes(boolean traceAllNodes) {
- this.traceAllNodes = traceAllNodes;
- }
-
- private static class TracerInterceptorSubclass extends TraceInterceptor {
- private List<StringBuilder> eventMessages;
- private boolean traceThisNode = true;
- private TraceInterceptorSubclassFactory factory;
-
- TracerInterceptorSubclass(ProcessorDefinition<?> node, Processor target, TraceFormatter formatter,
- Tracer tracer, List<StringBuilder> eventMessages, TraceInterceptorSubclassFactory factory) {
- super(node, target, formatter, tracer);
- this.eventMessages = eventMessages;
- this.factory = factory;
- while (target instanceof DelegateProcessor) {
- target = ((DelegateProcessor) target).getProcessor();
- }
- if (target.getClass().equals(TraceTestProcessor.class)) {
- traceThisNode = false;
- }
- }
-
- private synchronized void storeMessage(StringBuilder message) {
- eventMessages.add(message);
- }
-
- @Override
- protected void traceExchange(Exchange exchange) throws Exception {
- if (traceThisNode || factory.getTraceAllNodes()) {
- StringBuilder message = new StringBuilder();
- TraceHandlerTestHandler.recordComplete(message, getNode(), exchange);
- storeMessage(message);
- }
- }
-
- @Override
- protected Object traceExchangeIn(Exchange exchange) throws Exception {
- if (traceThisNode || factory.getTraceAllNodes()) {
- StringBuilder message = new StringBuilder();
- TraceHandlerTestHandler.recordIn(message, getNode(), exchange);
- return message;
- } else {
- return null;
- }
- }
-
- @Override
- protected void traceExchangeOut(Exchange exchange, Object traceState) throws Exception {
- if (traceThisNode || factory.getTraceAllNodes()) {
- if (StringBuilder.class.equals(traceState.getClass())) {
- StringBuilder message = (StringBuilder) traceState;
- TraceHandlerTestHandler.recordOut(message, getNode(), exchange);
- storeMessage(message);
- }
- }
- }
- }
-
-}
\ No newline at end of file
diff --git a/camel-core/src/test/java/org/apache/camel/processor/interceptor/TraceInterceptorSubclassTest.java b/camel-core/src/test/java/org/apache/camel/processor/interceptor/TraceInterceptorSubclassTest.java
deleted file mode 100644
index 8697c77..0000000
--- a/camel-core/src/test/java/org/apache/camel/processor/interceptor/TraceInterceptorSubclassTest.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.processor.interceptor;
-
-import java.util.LinkedList;
-
-import org.apache.camel.CamelContext;
-
-public class TraceInterceptorSubclassTest extends TracingTestBase {
-
- @Override
- protected void prepareTestTracerExceptionInOut() {
- super.prepareTestTracerExceptionInOut();
- ((TraceInterceptorSubclassFactory) ((Tracer) context.getDefaultTracer())
- .getTraceInterceptorFactory()).setTraceAllNodes(true);
- }
-
- @Override
- protected CamelContext createCamelContext() throws Exception {
- CamelContext contextLocal = super.createCamelContext();
-
- tracedMessages = new LinkedList<>();
-
- Tracer tracer = (Tracer) contextLocal.getDefaultTracer();
- tracer.setEnabled(true);
- tracer.setTraceExceptions(true);
- tracer.setTraceInterceptorFactory(new TraceInterceptorSubclassFactory(tracedMessages));
-
- return contextLocal;
- }
-
-}
diff --git a/camel-core/src/test/java/org/apache/camel/processor/interceptor/TraceTestProcessor.java b/camel-core/src/test/java/org/apache/camel/processor/interceptor/TraceTestProcessor.java
deleted file mode 100644
index accfff3..0000000
--- a/camel-core/src/test/java/org/apache/camel/processor/interceptor/TraceTestProcessor.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.processor.interceptor;
-
-import org.apache.camel.Exchange;
-import org.apache.camel.Processor;
-
-public class TraceTestProcessor implements Processor {
-
- public void process(Exchange exchange) throws Exception {
- String body = exchange.getIn().getBody(String.class);
- if ("Kaboom".equals(body)) {
- throw new Exception("Kaboom");
- }
- }
-
-}
diff --git a/camel-core/src/test/java/org/apache/camel/processor/interceptor/TracerTest.java b/camel-core/src/test/java/org/apache/camel/processor/interceptor/TracerTest.java
deleted file mode 100644
index aab2592..0000000
--- a/camel-core/src/test/java/org/apache/camel/processor/interceptor/TracerTest.java
+++ /dev/null
@@ -1,109 +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.processor.interceptor;
-import org.apache.camel.CamelContext;
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.impl.JndiRegistry;
-import org.junit.After;
-import org.junit.Test;
-
-/**
- * @version
- */
-public class TracerTest extends ContextTestSupport {
-
- private Tracer tracer;
-
- @Override
- protected JndiRegistry createRegistry() throws Exception {
- JndiRegistry jndi = super.createRegistry();
- jndi.bind("traceFormatter", new DefaultTraceFormatter());
- return jndi;
- }
-
- @Override
- protected CamelContext createCamelContext() throws Exception {
- CamelContext context = super.createCamelContext();
-
- tracer = Tracer.createTracer(context);
- tracer.setEnabled(true);
- tracer.setTraceInterceptors(true);
- tracer.setTraceFilter(body().contains("Camel"));
- tracer.setTraceExceptions(true);
- tracer.setLogStackTrace(true);
- tracer.setUseJpa(false);
- tracer.setDestination(context.getEndpoint("mock:traced"));
-
- context.addInterceptStrategy(tracer);
- tracer.start();
-
- return context;
- }
-
- @Override
- @After
- public void tearDown() throws Exception {
- tracer.stop();
- super.tearDown();
- }
-
- @Test
- public void testTracer() throws Exception {
- MockEndpoint tracer = getMockEndpoint("mock:traced");
- tracer.expectedMessageCount(1);
-
- MockEndpoint result = getMockEndpoint("mock:result");
- result.expectedMessageCount(3);
-
- template.sendBody("direct:start", "Hello World");
- template.sendBody("direct:start", "Bye World");
- template.sendBody("direct:start", "Hello Camel");
-
- assertMockEndpointsSatisfied();
-
- DefaultTraceEventMessage em = tracer.getReceivedExchanges().get(0).getIn().getBody(DefaultTraceEventMessage.class);
- assertEquals("Hello Camel", em.getBody());
-
- assertEquals("String", em.getBodyType());
- assertEquals(null, em.getCausedByException());
- assertNotNull(em.getExchangeId());
- assertNotNull(em.getShortExchangeId());
- assertNotNull(em.getExchangePattern());
- assertEquals("direct://start", em.getFromEndpointUri());
- // there is always a breadcrumb header
- assertNotNull(em.getHeaders());
- assertNotNull(em.getProperties());
- assertNull(em.getOutBody());
- assertNull(em.getOutBodyType());
- assertNull(em.getOutHeaders());
- assertNull(em.getPreviousNode());
- assertNotNull(em.getToNode());
- assertNotNull(em.getTimestamp());
- }
-
- @Override
- protected RouteBuilder createRouteBuilder() throws Exception {
- return new RouteBuilder() {
- @Override
- public void configure() throws Exception {
- from("direct:start").to("mock:result");
- }
- };
- }
-}
diff --git a/camel-core/src/test/java/org/apache/camel/processor/interceptor/TracingRedeliveryIssueTest.java b/camel-core/src/test/java/org/apache/camel/processor/interceptor/TracingRedeliveryIssueTest.java
deleted file mode 100644
index b4a85bf..0000000
--- a/camel-core/src/test/java/org/apache/camel/processor/interceptor/TracingRedeliveryIssueTest.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.processor.interceptor;
-
-import org.apache.camel.ProducerTemplate;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.impl.DefaultCamelContext;
-import org.junit.Assert;
-import org.junit.Test;
-
-public class TracingRedeliveryIssueTest extends Assert {
-
- @Test
- public void testTracing() throws Exception {
- DefaultCamelContext context = new DefaultCamelContext();
- context.addRoutes(new RouteBuilder() {
- @Override
- public void configure() throws Exception {
- errorHandler(defaultErrorHandler().maximumRedeliveries(3).redeliveryDelay(2000L));
-
- from("direct:start").to("mock:result");
- }
- });
-
- // Enable Tracer.
- context.setTracing(true);
- Tracer tracer = new Tracer();
- tracer.setDestinationUri("mock:traced");
- context.setDefaultTracer(tracer);
- context.start();
-
- MockEndpoint result = context.getEndpoint("mock:result", MockEndpoint.class);
- result.setExpectedMessageCount(1);
- MockEndpoint traced = context.getEndpoint("mock:traced", MockEndpoint.class);
- traced.setExpectedMessageCount(1);
-
- ProducerTemplate template = context.createProducerTemplate();
- template.sendBody("direct:start", "foo");
-
- MockEndpoint.assertIsSatisfied(result, traced);
-
- context.stop();
- }
-
-}
diff --git a/camel-core/src/test/java/org/apache/camel/processor/interceptor/TracingTestBase.java b/camel-core/src/test/java/org/apache/camel/processor/interceptor/TracingTestBase.java
deleted file mode 100644
index 84a0bec..0000000
--- a/camel-core/src/test/java/org/apache/camel/processor/interceptor/TracingTestBase.java
+++ /dev/null
@@ -1,138 +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.processor.interceptor;
-
-import java.util.List;
-
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.junit.Test;
-
-public abstract class TracingTestBase extends ContextTestSupport {
- protected List<StringBuilder> tracedMessages;
- private TraceTestProcessor processor = new TraceTestProcessor();
-
- protected void prepareTestTracerInOnly() {
- }
-
- protected void prepareTestTracerInOut() {
- }
-
- protected void prepareTestTracerExceptionInOut() {
- }
-
- protected void validateTestTracerInOnly() {
- assertEquals(3, tracedMessages.size());
- for (StringBuilder tracedMessage : tracedMessages) {
- String message = tracedMessage.toString();
- assertTrue(message.startsWith("Complete:"));
- }
- }
-
- protected void validateTestTracerInOut() {
- assertEquals(3, tracedMessages.size());
- for (StringBuilder tracedMessage : tracedMessages) {
- String message = tracedMessage.toString();
- assertTrue(message.startsWith("In:"));
- assertTrue(message.contains("Out:"));
- }
- }
-
- protected void validateTestTracerExceptionInOut() {
- assertEquals(5, tracedMessages.size());
- for (StringBuilder tracedMessage : tracedMessages) {
- String message = tracedMessage.toString();
- assertTrue(message.startsWith("In:"));
- assertTrue(message.contains("Out:"));
- }
- assertTrue(tracedMessages.get(2).toString().contains("Ex:"));
- }
-
- protected int getMessageCount() {
- return tracedMessages.size();
- }
-
- @Test
- public void testTracerInOnly() throws Exception {
- MockEndpoint result = getMockEndpoint("mock:result");
- ((Tracer) context.getDefaultTracer()).setTraceOutExchanges(false);
- result.expectedMessageCount(3);
- prepareTestTracerInOnly();
-
- template.sendBody("direct:start", "Hello World");
- template.sendBody("direct:start", "Bye World");
- template.sendBody("direct:start", "Hello Camel");
-
- assertMockEndpointsSatisfied();
-
- validateTestTracerInOnly();
- }
-
- @Test
- public void testTracerInOut() throws Exception {
- MockEndpoint result = getMockEndpoint("mock:result");
- ((Tracer) context.getDefaultTracer()).setTraceOutExchanges(true);
- result.expectedMessageCount(3);
- prepareTestTracerInOut();
-
- template.sendBody("direct:start", "Hello World");
- template.sendBody("direct:start", "Bye World");
- template.sendBody("direct:start", "Hello Camel");
-
- assertMockEndpointsSatisfied();
-
- validateTestTracerInOut();
- }
-
- @Test
- public void testTracerExceptionInOut() throws Exception {
- MockEndpoint result = getMockEndpoint("mock:result");
- ((Tracer) context.getDefaultTracer()).setTraceOutExchanges(true);
- result.expectedMessageCount(2);
- prepareTestTracerExceptionInOut();
-
- template.sendBody("direct:start", "Hello World");
- try {
- template.sendBody("direct:start", "Kaboom");
- fail("Should have thrown exception");
- } catch (Exception e) {
- // ignore
- }
- template.sendBody("direct:start", "Hello Camel");
-
- assertMockEndpointsSatisfied();
-
- validateTestTracerExceptionInOut();
- }
-
- @Override
- protected RouteBuilder createRouteBuilder() throws Exception {
- return new RouteBuilder() {
- @Override
- public void configure() throws Exception {
- context.setTracing(true);
-
- from("direct:start")
- .tracing()
- .process(processor)
- .to("mock:result");
- }
- };
-
- }
-}
diff --git a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/CamelAwsXRayTestSupport.java b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/CamelAwsXRayTestSupport.java
index 1f1f203..ac80140 100644
--- a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/CamelAwsXRayTestSupport.java
+++ b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/CamelAwsXRayTestSupport.java
@@ -23,9 +23,7 @@ import java.util.Map;
import java.util.Set;
import org.apache.camel.CamelContext;
-import org.apache.camel.LoggingLevel;
import org.apache.camel.component.aws.xray.TestDataBuilder.TestTrace;
-import org.apache.camel.processor.interceptor.Tracer;
import org.apache.camel.spi.InterceptStrategy;
import org.apache.camel.test.junit4.CamelTestSupport;
import org.junit.Rule;
@@ -57,10 +55,6 @@ public class CamelAwsXRayTestSupport extends CamelTestSupport {
CamelContext context = super.createCamelContext();
context.setTracing(true);
- final Tracer tracer = new Tracer();
- tracer.getDefaultTraceFormatter().setShowBody(false);
- tracer.setLogLevel(LoggingLevel.INFO);
- context.getInterceptStrategies().add(tracer);
XRayTracer xRayTracer = new XRayTracer();
xRayTracer.setCamelContext(context);
diff --git a/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindyMarshalOneToManyWithHeadersTest.java b/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindyMarshalOneToManyWithHeadersTest.java
index eba8ace..d491d00 100644
--- a/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindyMarshalOneToManyWithHeadersTest.java
+++ b/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindyMarshalOneToManyWithHeadersTest.java
@@ -20,14 +20,13 @@ import java.util.Arrays;
import java.util.List;
import org.apache.camel.EndpointInject;
-import org.apache.camel.LoggingLevel;
import org.apache.camel.Produce;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.dataformat.bindy.model.simple.linkonetomany.Order;
import org.apache.camel.dataformat.bindy.model.simple.linkonetomany.OrderItem;
-import org.apache.camel.processor.interceptor.Tracer;
+
import org.junit.Test;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ContextConfiguration;
@@ -88,12 +87,6 @@ public class BindyMarshalOneToManyWithHeadersTest extends AbstractJUnit4SpringCo
public void configure() {
- Tracer tracer = new Tracer();
- tracer.setLogLevel(LoggingLevel.INFO);
- tracer.setLogName("org.apache.camel.bindy");
-
- getContext().addInterceptStrategy(tracer);
-
BindyCsvDataFormat camelDataFormat = new BindyCsvDataFormat(Order.class);
camelDataFormat.setLocale("en");
diff --git a/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindyPojoSimpleCsvMarshallTest.java b/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindyPojoSimpleCsvMarshallTest.java
index 8e39b98..4c97c2f 100644
--- a/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindyPojoSimpleCsvMarshallTest.java
+++ b/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindyPojoSimpleCsvMarshallTest.java
@@ -22,13 +22,12 @@ import java.util.GregorianCalendar;
import java.util.TimeZone;
import org.apache.camel.EndpointInject;
-import org.apache.camel.LoggingLevel;
import org.apache.camel.Produce;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.dataformat.bindy.model.simple.oneclass.Order;
-import org.apache.camel.processor.interceptor.Tracer;
+
import org.junit.Test;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ContextConfiguration;
@@ -97,12 +96,6 @@ public class BindyPojoSimpleCsvMarshallTest extends AbstractJUnit4SpringContextT
new BindyCsvDataFormat(org.apache.camel.dataformat.bindy.model.simple.oneclass.Order.class);
camelDataFormat.setLocale("en");
- Tracer tracer = new Tracer();
- tracer.setLogLevel(LoggingLevel.ERROR);
- tracer.setLogName("org.apache.camel.bindy");
-
- getContext().addInterceptStrategy(tracer);
-
// default should errors go to mock:error
errorHandler(deadLetterChannel(URI_MOCK_ERROR).redeliveryDelay(0));
diff --git a/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindySimpleCsvBooleanUnmarshallTest.java b/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindySimpleCsvBooleanUnmarshallTest.java
index 9861e53..dbad3cd 100644
--- a/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindySimpleCsvBooleanUnmarshallTest.java
+++ b/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindySimpleCsvBooleanUnmarshallTest.java
@@ -19,13 +19,12 @@ package org.apache.camel.dataformat.bindy.csv;
import java.util.List;
import org.apache.camel.EndpointInject;
-import org.apache.camel.LoggingLevel;
import org.apache.camel.Produce;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.dataformat.bindy.model.simple.bool.BooleanExample;
-import org.apache.camel.processor.interceptor.Tracer;
+
import org.junit.Test;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ContextConfiguration;
@@ -112,12 +111,6 @@ public class BindySimpleCsvBooleanUnmarshallTest extends AbstractJUnit4SpringCon
public void configure() {
// from("file://src/test/data?move=./target/done").unmarshal(camelDataFormat).to("mock:result");
- Tracer tracer = new Tracer();
- tracer.setLogLevel(LoggingLevel.ERROR);
- tracer.setLogName("org.apache.camel.bindy");
-
- getContext().addInterceptStrategy(tracer);
-
// default should errors go to mock:error
errorHandler(deadLetterChannel(URI_MOCK_ERROR).redeliveryDelay(0));
diff --git a/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindySimpleCsvMarshallPositionModifiedTest.java b/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindySimpleCsvMarshallPositionModifiedTest.java
index d7e8b3b..e077918 100644
--- a/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindySimpleCsvMarshallPositionModifiedTest.java
+++ b/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindySimpleCsvMarshallPositionModifiedTest.java
@@ -24,11 +24,10 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import org.apache.camel.LoggingLevel;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.dataformat.bindy.CommonBindyTest;
import org.apache.camel.dataformat.bindy.model.simple.oneclassdifferentposition.Order;
-import org.apache.camel.processor.interceptor.Tracer;
+
import org.junit.Test;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ContextConfiguration;
@@ -80,12 +79,6 @@ public class BindySimpleCsvMarshallPositionModifiedTest extends CommonBindyTest
public void configure() {
- Tracer tracer = new Tracer();
- tracer.setLogLevel(LoggingLevel.ERROR);
- tracer.setLogName("org.apache.camel.bindy");
-
- getContext().addInterceptStrategy(tracer);
-
BindyCsvDataFormat csvBindyDataFormat = new BindyCsvDataFormat(org.apache.camel.dataformat.bindy.model.simple.oneclassdifferentposition.Order.class);
csvBindyDataFormat.setLocale("en");
diff --git a/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindySimpleCsvMarshallTest.java b/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindySimpleCsvMarshallTest.java
index 70689f9..be2812a 100644
--- a/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindySimpleCsvMarshallTest.java
+++ b/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindySimpleCsvMarshallTest.java
@@ -26,13 +26,12 @@ import java.util.Map;
import java.util.TimeZone;
import org.apache.camel.EndpointInject;
-import org.apache.camel.LoggingLevel;
import org.apache.camel.Produce;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.dataformat.bindy.model.simple.oneclass.Order;
-import org.apache.camel.processor.interceptor.Tracer;
+
import org.junit.Test;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ContextConfiguration;
@@ -103,12 +102,6 @@ public class BindySimpleCsvMarshallTest extends AbstractJUnit4SpringContextTests
public void configure() {
- Tracer tracer = new Tracer();
- tracer.setLogLevel(LoggingLevel.ERROR);
- tracer.setLogName("org.apache.camel.bindy");
-
- getContext().addInterceptStrategy(tracer);
-
BindyCsvDataFormat camelDataFormat = new BindyCsvDataFormat(org.apache.camel.dataformat.bindy.model.simple.oneclass.Order.class);
camelDataFormat.setLocale("en");
diff --git a/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindySimpleCsvUnmarshallBadIntegerTest.java b/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindySimpleCsvUnmarshallBadIntegerTest.java
index b2e458c..5542f27 100644
--- a/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindySimpleCsvUnmarshallBadIntegerTest.java
+++ b/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindySimpleCsvUnmarshallBadIntegerTest.java
@@ -19,12 +19,10 @@ package org.apache.camel.dataformat.bindy.csv;
import org.apache.camel.EndpointInject;
import org.apache.camel.Exchange;
-import org.apache.camel.LoggingLevel;
import org.apache.camel.Produce;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.processor.interceptor.Tracer;
import org.apache.camel.test.junit4.TestSupport;
import org.junit.Test;
import org.slf4j.Logger;
@@ -100,14 +98,6 @@ public class BindySimpleCsvUnmarshallBadIntegerTest extends AbstractJUnit4Spring
public void configure() {
- Tracer tracer = new Tracer();
- tracer.setLogLevel(LoggingLevel.ERROR);
- tracer.setLogName("org.apache.camel.bindy");
- tracer.setLogStackTrace(true);
- tracer.setTraceExceptions(true);
-
- getContext().addInterceptStrategy(tracer);
-
// default should errors go to mock:error
errorHandler(deadLetterChannel(URI_MOCK_ERROR));
diff --git a/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindySimpleCsvUnmarshallPositionModifiedTest.java b/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindySimpleCsvUnmarshallPositionModifiedTest.java
index 8ad7d83..d8e2bbc 100644
--- a/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindySimpleCsvUnmarshallPositionModifiedTest.java
+++ b/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindySimpleCsvUnmarshallPositionModifiedTest.java
@@ -18,13 +18,11 @@ package org.apache.camel.dataformat.bindy.csv;
import org.apache.camel.EndpointInject;
import org.apache.camel.Exchange;
-import org.apache.camel.LoggingLevel;
import org.apache.camel.Produce;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.dataformat.bindy.format.FormatException;
-import org.apache.camel.processor.interceptor.Tracer;
import org.apache.camel.test.junit4.TestSupport;
import org.junit.Test;
import org.springframework.test.annotation.DirtiesContext;
@@ -93,12 +91,6 @@ public class BindySimpleCsvUnmarshallPositionModifiedTest extends AbstractJUnit4
public void configure() {
- Tracer tracer = new Tracer();
- tracer.setLogLevel(LoggingLevel.ERROR);
- tracer.setLogName("org.apache.camel.bindy");
-
- getContext().addInterceptStrategy(tracer);
-
// default should errors go to mock:error
errorHandler(deadLetterChannel(URI_MOCK_ERROR).redeliveryDelay(0));
diff --git a/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindySimpleCsvUnmarshallTest.java b/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindySimpleCsvUnmarshallTest.java
index 6b08831..aef74c2 100644
--- a/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindySimpleCsvUnmarshallTest.java
+++ b/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindySimpleCsvUnmarshallTest.java
@@ -20,14 +20,12 @@ import java.util.List;
import org.apache.camel.EndpointInject;
import org.apache.camel.Exchange;
-import org.apache.camel.LoggingLevel;
import org.apache.camel.Produce;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.dataformat.bindy.format.FormatException;
import org.apache.camel.dataformat.bindy.model.simple.oneclass.Order;
-import org.apache.camel.processor.interceptor.Tracer;
import org.apache.camel.test.junit4.TestSupport;
import org.junit.Test;
import org.springframework.test.annotation.DirtiesContext;
@@ -142,12 +140,6 @@ public class BindySimpleCsvUnmarshallTest extends AbstractJUnit4SpringContextTes
public void configure() {
// from("file://src/test/data?move=./target/done").unmarshal(camelDataFormat).to("mock:result");
- Tracer tracer = new Tracer();
- tracer.setLogLevel(LoggingLevel.ERROR);
- tracer.setLogName("org.apache.camel.bindy");
-
- getContext().addInterceptStrategy(tracer);
-
// default should errors go to mock:error
errorHandler(deadLetterChannel(URI_MOCK_ERROR).redeliveryDelay(0));
diff --git a/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairWithoutSectionMarshallDslTest.java b/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairWithoutSectionMarshallDslTest.java
index d392a8b..48f64d4 100644
--- a/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairWithoutSectionMarshallDslTest.java
+++ b/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairWithoutSectionMarshallDslTest.java
@@ -23,14 +23,13 @@ import java.util.Map;
import org.apache.camel.EndpointInject;
import org.apache.camel.Exchange;
-import org.apache.camel.LoggingLevel;
import org.apache.camel.Produce;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.dataformat.bindy.kvp.BindyKeyValuePairDataFormat;
import org.apache.camel.dataformat.bindy.model.fix.withoutsection.Order;
-import org.apache.camel.processor.interceptor.Tracer;
+
import org.junit.Test;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
@@ -100,14 +99,6 @@ public class BindySimpleKeyValuePairWithoutSectionMarshallDslTest extends Abstra
public void configure() {
- Tracer tracer = new Tracer();
- tracer.setLogLevel(LoggingLevel.ERROR);
- tracer.setLogName("org.apache.camel.bindy");
- tracer.setLogStackTrace(true);
- tracer.setTraceExceptions(true);
-
- getContext().addInterceptStrategy(tracer);
-
// default should errors go to mock:error
errorHandler(deadLetterChannel(URI_MOCK_ERROR));
diff --git a/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fixed/marshall/simple/BindySimpleFixedLengthMarshallTest.java b/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fixed/marshall/simple/BindySimpleFixedLengthMarshallTest.java
index ac8cdf2..5d1a61a 100644
--- a/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fixed/marshall/simple/BindySimpleFixedLengthMarshallTest.java
+++ b/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fixed/marshall/simple/BindySimpleFixedLengthMarshallTest.java
@@ -26,7 +26,6 @@ import java.util.List;
import java.util.Map;
import org.apache.camel.EndpointInject;
-import org.apache.camel.LoggingLevel;
import org.apache.camel.Produce;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
@@ -35,7 +34,7 @@ import org.apache.camel.dataformat.bindy.annotation.DataField;
import org.apache.camel.dataformat.bindy.annotation.FixedLengthRecord;
import org.apache.camel.model.dataformat.BindyDataFormat;
import org.apache.camel.model.dataformat.BindyType;
-import org.apache.camel.processor.interceptor.Tracer;
+
import org.junit.Test;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ContextConfiguration;
@@ -97,12 +96,6 @@ public class BindySimpleFixedLengthMarshallTest extends AbstractJUnit4SpringCont
public static class ContextConfig extends RouteBuilder {
public void configure() {
- Tracer tracer = new Tracer();
- tracer.setLogLevel(LoggingLevel.ERROR);
- tracer.setLogName("org.apache.camel.bindy");
-
- getContext().addInterceptStrategy(tracer);
-
// default should errors go to mock:error
errorHandler(deadLetterChannel(URI_MOCK_ERROR).redeliveryDelay(0));
diff --git a/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fixed/marshall/simple/BindySimpleFixedLengthObjectMarshallTest.java b/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fixed/marshall/simple/BindySimpleFixedLengthObjectMarshallTest.java
index e826ac6..baec317 100644
--- a/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fixed/marshall/simple/BindySimpleFixedLengthObjectMarshallTest.java
+++ b/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fixed/marshall/simple/BindySimpleFixedLengthObjectMarshallTest.java
@@ -24,7 +24,6 @@ import java.util.GregorianCalendar;
import java.util.List;
import org.apache.camel.EndpointInject;
-import org.apache.camel.LoggingLevel;
import org.apache.camel.Produce;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
@@ -33,7 +32,6 @@ import org.apache.camel.dataformat.bindy.annotation.DataField;
import org.apache.camel.dataformat.bindy.annotation.FixedLengthRecord;
import org.apache.camel.model.dataformat.BindyDataFormat;
import org.apache.camel.model.dataformat.BindyType;
-import org.apache.camel.processor.interceptor.Tracer;
import org.apache.camel.spring.boot.TypeConversionConfiguration;
import org.apache.camel.spring.javaconfig.SingleRouteCamelConfiguration;
import org.apache.camel.test.spring.CamelSpringDelegatingTestContextLoader;
@@ -75,11 +73,6 @@ public class BindySimpleFixedLengthObjectMarshallTest extends AbstractJUnit4Spri
public RouteBuilder route() {
return new RouteBuilder() {
public void configure() {
- Tracer tracer = new Tracer();
- tracer.setLogLevel(LoggingLevel.ERROR);
- tracer.setLogName("org.apache.camel.bindy");
- getContext().addInterceptStrategy(tracer);
-
// default should errors go to mock:error
errorHandler(deadLetterChannel(URI_MOCK_ERROR).redeliveryDelay(0));
diff --git a/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java b/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java
index bd19ede..a7e359c 100644
--- a/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java
+++ b/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java
@@ -83,8 +83,6 @@ import org.apache.camel.model.transformer.TransformersDefinition;
import org.apache.camel.model.validator.ValidatorsDefinition;
import org.apache.camel.processor.interceptor.BacklogTracer;
import org.apache.camel.processor.interceptor.HandleFault;
-import org.apache.camel.processor.interceptor.TraceFormatter;
-import org.apache.camel.processor.interceptor.Tracer;
import org.apache.camel.runtimecatalog.JSonSchemaResolver;
import org.apache.camel.spi.AsyncProcessorAwaitManager;
import org.apache.camel.spi.ClassResolver;
@@ -204,16 +202,6 @@ public abstract class AbstractCamelContextFactoryBean<T extends ModelCamelContex
// setup JMX agent at first
initJMXAgent();
- Tracer tracer = getBeanForType(Tracer.class);
- if (tracer != null) {
- // use formatter if there is a TraceFormatter bean defined
- TraceFormatter formatter = getBeanForType(TraceFormatter.class);
- if (formatter != null) {
- tracer.setFormatter(formatter);
- }
- LOG.info("Using custom Tracer: {}", tracer);
- getContext().addInterceptStrategy(tracer);
- }
BacklogTracer backlogTracer = getBeanForType(BacklogTracer.class);
if (backlogTracer != null) {
LOG.info("Using custom BacklogTracer: {}", backlogTracer);
diff --git a/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/context-camel-1145.xml b/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/context-camel-1145.xml
deleted file mode 100644
index a02bb5f..0000000
--- a/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/context-camel-1145.xml
+++ /dev/null
@@ -1,62 +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"
- xmlns:camel="http://camel.apache.org/schema/spring"
- xmlns:jaxws="http://cxf.apache.org/jaxws"
- xmlns:http="http://cxf.apache.org/transports/http/configuration"
- xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration"
-
- xsi:schemaLocation="
- http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
- http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
- http://cxf.apache.org/transports/http-jetty/configuration http://cxf.apache.org/schemas/configuration/http-jetty.xsd
- http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang.xsd
- http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
- ">
-
- <camel:camelContext id="camelJiraContext">
- <camel:jmxAgent id="agent" disabled="true" />
- <camel:routeBuilder ref="routeBuilder" />
- </camel:camelContext>
-
- <bean id="camelTracer" class="org.apache.camel.processor.interceptor.Tracer">
- <property name="enabled" value="true"/>
- <property name="traceExceptions" value="true"/>
- <property name="traceInterceptors" value="true"/>
- <property name="logLevel" value="INFO"/>
- </bean>
-
- <bean id="traceFormatter" class="org.apache.camel.processor.interceptor.DefaultTraceFormatter">
- <property name="showBody" value="true"/>
- <property name="showBodyType" value="true"/>
- <property name="showProperties" value="true"/>
- <property name="showHeaders" value="true"/>
- </bean>
-
- <bean id="producerTemplate"
- factory-bean="camelJiraContext"
- factory-method="createProducerTemplate">
- </bean>
-
- <bean id="routeBuilder" class="org.apache.camel.component.cxf.RouteBuilderCxfTracer"/>
-</beans>
\ No newline at end of file
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/PaddyRouteTest.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/PaddyRouteTest.java
index 33e046e..45d4ab0 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/PaddyRouteTest.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/PaddyRouteTest.java
@@ -20,7 +20,7 @@ import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.processor.interceptor.Tracer;
+
import org.junit.Test;
/**
@@ -47,8 +47,6 @@ public class PaddyRouteTest extends FtpServerTestSupport {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
- getContext().addInterceptStrategy(new Tracer());
-
from(getFtpUrl()).process(new Processor() {
public void process(Exchange exchange) throws Exception {
assertNotNull(exchange.getIn().getHeader(Exchange.FILE_NAME));
diff --git a/components/camel-jpa/src/main/java/org/apache/camel/processor/interceptor/jpa/JpaTraceEventMessage.java b/components/camel-jpa/src/main/java/org/apache/camel/processor/interceptor/jpa/JpaTraceEventMessage.java
deleted file mode 100644
index 4588461..0000000
--- a/components/camel-jpa/src/main/java/org/apache/camel/processor/interceptor/jpa/JpaTraceEventMessage.java
+++ /dev/null
@@ -1,220 +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.processor.interceptor.jpa;
-
-import java.io.Serializable;
-import java.util.Date;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.Lob;
-import javax.persistence.Table;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
-import javax.persistence.Transient;
-
-import org.apache.camel.Exchange;
-import org.apache.camel.processor.interceptor.TraceEventMessage;
-
-/**
- * A JPA based {@link org.apache.camel.processor.interceptor.TraceEventMessage} that is capable of persisting
- * trace event into a database.
- */
-@Entity
-@Table(
- name = "CAMEL_MESSAGETRACED"
-)
-public class JpaTraceEventMessage implements TraceEventMessage, Serializable {
- private static final long serialVersionUID = -3577516047575267548L;
-
- protected Long id;
- protected Date timestamp;
- protected String fromEndpointUri;
- protected String previousNode;
- protected String toNode;
- protected String exchangeId;
- protected String shortExchangeId;
- protected String exchangePattern;
- protected String properties;
- protected String headers;
- protected String body;
- protected String bodyType;
- protected String outHeaders;
- protected String outBody;
- protected String outBodyType;
- protected String causedByException;
- protected String routeId;
-
- public JpaTraceEventMessage() {
- }
-
- @Id
- @GeneratedValue
- public Long getId() {
- return id;
- }
-
- public void setId(Long id) {
- this.id = id;
- }
-
- @Temporal(TemporalType.TIMESTAMP)
- public Date getTimestamp() {
- return timestamp;
- }
-
- public void setTimestamp(Date timestamp) {
- this.timestamp = timestamp;
- }
-
- public String getPreviousNode() {
- return previousNode;
- }
-
- public void setPreviousNode(String previousNode) {
- this.previousNode = previousNode;
- }
-
- public String getFromEndpointUri() {
- return fromEndpointUri;
- }
-
- public void setFromEndpointUri(String fromEndpointUri) {
- this.fromEndpointUri = fromEndpointUri;
- }
-
- public String getToNode() {
- return toNode;
- }
-
- public void setToNode(String toNode) {
- this.toNode = toNode;
- }
-
- public String getExchangeId() {
- return exchangeId;
- }
-
- public void setExchangeId(String exchangeId) {
- this.exchangeId = exchangeId;
- }
-
- public String getShortExchangeId() {
- return shortExchangeId;
- }
-
- public void setShortExchangeId(String shortExchangeId) {
- this.shortExchangeId = shortExchangeId;
- }
-
- public String getExchangePattern() {
- return exchangePattern;
- }
-
- public void setExchangePattern(String exchangePattern) {
- this.exchangePattern = exchangePattern;
- }
-
- @Lob
- public String getProperties() {
- return properties;
- }
-
- public void setProperties(String properties) {
- this.properties = properties;
- }
-
- @Lob
- public String getHeaders() {
- return headers;
- }
-
- public void setHeaders(String headers) {
- this.headers = headers;
- }
-
- @Lob
- public String getBody() {
- return body;
- }
-
- public void setBody(String body) {
- this.body = body;
- }
-
- public String getBodyType() {
- return bodyType;
- }
-
- public void setBodyType(String bodyType) {
- this.bodyType = bodyType;
- }
-
- @Lob
- public String getOutBody() {
- return outBody;
- }
-
- public void setOutBody(String outBody) {
- this.outBody = outBody;
- }
-
- public String getOutBodyType() {
- return outBodyType;
- }
-
- public void setOutBodyType(String outBodyType) {
- this.outBodyType = outBodyType;
- }
-
- @Lob
- public String getOutHeaders() {
- return outHeaders;
- }
-
- public void setOutHeaders(String outHeaders) {
- this.outHeaders = outHeaders;
- }
-
- @Lob
- public String getCausedByException() {
- return causedByException;
- }
-
- public void setCausedByException(String causedByException) {
- this.causedByException = causedByException;
- }
-
- public String getRouteId() {
- return routeId;
- }
-
- public void setRouteId(String routeId) {
- this.routeId = routeId;
- }
-
- @Transient
- public Exchange getTracedExchange() {
- return null;
- }
-
- @Override
- public String toString() {
- return "TraceEventMessage[" + getExchangeId() + "] on node: " + getToNode();
- }
-
-}
diff --git a/components/camel-jpa/src/test/java/org/apache/camel/processor/interceptor/JpaTraceEventMessageTest.java b/components/camel-jpa/src/test/java/org/apache/camel/processor/interceptor/JpaTraceEventMessageTest.java
deleted file mode 100644
index 41bc36e..0000000
--- a/components/camel-jpa/src/test/java/org/apache/camel/processor/interceptor/JpaTraceEventMessageTest.java
+++ /dev/null
@@ -1,121 +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.processor.interceptor;
-
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.processor.interceptor.jpa.JpaTraceEventMessage;
-import org.apache.camel.spring.SpringCamelContext;
-import org.apache.camel.spring.SpringRouteBuilder;
-import org.apache.camel.test.junit4.CamelTestSupport;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
-import org.springframework.transaction.TransactionStatus;
-import org.springframework.transaction.support.TransactionCallback;
-import org.springframework.transaction.support.TransactionTemplate;
-
-/**
- * @version
- */
-public class JpaTraceEventMessageTest extends CamelTestSupport {
- protected static final String SELECT_ALL_STRING = "select x from " + JpaTraceEventMessage.class.getName() + " x";
-
- protected ApplicationContext applicationContext;
- protected TransactionTemplate transactionTemplate;
- protected EntityManager entityManager;
-
- @Before
- public void setUp() throws Exception {
- super.setUp();
- EntityManagerFactory entityManagerFactory = applicationContext.getBean("entityManagerFactory",
- EntityManagerFactory.class);
- transactionTemplate = applicationContext.getBean("transactionTemplate", TransactionTemplate.class);
- entityManager = entityManagerFactory.createEntityManager();
- cleanupRepository();
- }
-
- @After
- public void tearDown() throws Exception {
- super.tearDown();
- entityManager.close();
- }
-
- @Test
- public void testSendTraceMessage() throws Exception {
- MockEndpoint mock = getMockEndpoint("mock:result");
- mock.expectedMessageCount(1);
-
- template.sendBody("direct:start", "Hello World");
-
- assertMockEndpointsSatisfied();
- assertEntityInDB();
- }
-
- @Override
- protected CamelContext createCamelContext() throws Exception {
- applicationContext = new ClassPathXmlApplicationContext("org/apache/camel/processor/interceptor/springJpaTraveEvent.xml");
- return SpringCamelContext.springCamelContext(applicationContext);
- }
-
- @Override
- protected RouteBuilder createRouteBuilder() {
- return new SpringRouteBuilder() {
- public void configure() {
- Tracer tracer = new Tracer();
- tracer.setDestinationUri("jpa://" + JpaTraceEventMessage.class.getName() + "?persistenceUnit=trace");
- tracer.setUseJpa(true);
- getContext().addInterceptStrategy(tracer);
-
- from("direct:start").routeId("foo").to("mock:result");
- }
- };
- }
-
- private void assertEntityInDB() throws Exception {
- List<?> list = entityManager.createQuery(SELECT_ALL_STRING).getResultList();
- assertEquals(1, list.size());
-
- JpaTraceEventMessage db = (JpaTraceEventMessage)list.get(0);
- assertNotNull(db.getId());
- assertEquals("direct://start", db.getFromEndpointUri());
- assertEquals("mock://result", db.getToNode());
- assertEquals("foo", db.getRouteId());
- }
-
- protected void cleanupRepository() {
- transactionTemplate.execute(new TransactionCallback<Object>() {
- public Object doInTransaction(TransactionStatus arg0) {
- entityManager.joinTransaction();
- List<?> list = entityManager.createQuery(SELECT_ALL_STRING).getResultList();
- for (Object item : list) {
- entityManager.remove(item);
- }
- entityManager.flush();
- return Boolean.TRUE;
- }
- });
- }
-}
\ No newline at end of file
diff --git a/components/camel-jpa/src/test/resources/META-INF/persistence.xml b/components/camel-jpa/src/test/resources/META-INF/persistence.xml
index 42a485c..f0c146b 100644
--- a/components/camel-jpa/src/test/resources/META-INF/persistence.xml
+++ b/components/camel-jpa/src/test/resources/META-INF/persistence.xml
@@ -77,20 +77,6 @@
</persistence-unit>
<!-- END SNIPPET: e1 -->
- <!-- START SNIPPET: e2 -->
- <persistence-unit name="trace" transaction-type="RESOURCE_LOCAL">
- <class>org.apache.camel.processor.interceptor.jpa.JpaTraceEventMessage</class>
-
- <properties>
- <property name="openjpa.ConnectionURL" value="jdbc:derby:target/trace;create=true"/>
- <property name="openjpa.ConnectionDriverName" value="org.apache.derby.jdbc.EmbeddedDriver"/>
- <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema"/>
- <property name="openjpa.Log" value="DefaultLevel=WARN, Tool=INFO"/>
- <property name="openjpa.Multithreaded" value="true"/>
- </properties>
- </persistence-unit>
- <!-- END SNIPPET: e2 -->
-
<persistence-unit name="skipLockedEntiy" transaction-type="RESOURCE_LOCAL">
<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
<class>org.apache.camel.examples.VersionedItem</class>
diff --git a/components/camel-jpa/src/test/resources/profiles/hibernate/META-INF/persistence.xml b/components/camel-jpa/src/test/resources/profiles/hibernate/META-INF/persistence.xml
index 83b1ffd..433cf74 100644
--- a/components/camel-jpa/src/test/resources/profiles/hibernate/META-INF/persistence.xml
+++ b/components/camel-jpa/src/test/resources/profiles/hibernate/META-INF/persistence.xml
@@ -67,19 +67,6 @@
</properties>
</persistence-unit>
- <persistence-unit name="trace" transaction-type="RESOURCE_LOCAL">
- <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
-
- <class>org.apache.camel.processor.interceptor.jpa.JpaTraceEventMessage</class>
-
- <properties>
- <property name="hibernate.dialect" value="org.hibernate.dialect.DerbyTenSevenDialect"/>
- <property name="hibernate.connection.driver_class" value="org.apache.derby.jdbc.EmbeddedDriver"/>
- <property name="hibernate.connection.url" value="jdbc:derby:target/trace;create=true"/>
- <property name="hibernate.hbm2ddl.auto" value="create"/>
- </properties>
- </persistence-unit>
-
<persistence-unit name="skipLockedEntiy" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
diff --git a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelAutoConfiguration.java b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelAutoConfiguration.java
index 811f3a4..7e120a2 100644
--- a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelAutoConfiguration.java
+++ b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelAutoConfiguration.java
@@ -42,10 +42,7 @@ import org.apache.camel.impl.CompositeRegistry;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.impl.FileWatcherReloadStrategy;
import org.apache.camel.processor.interceptor.BacklogTracer;
-import org.apache.camel.processor.interceptor.DefaultTraceFormatter;
import org.apache.camel.processor.interceptor.HandleFault;
-import org.apache.camel.processor.interceptor.TraceFormatter;
-import org.apache.camel.processor.interceptor.Tracer;
import org.apache.camel.spi.AsyncProcessorAwaitManager;
import org.apache.camel.spi.EndpointStrategy;
import org.apache.camel.spi.EventFactory;
@@ -216,32 +213,6 @@ public class CamelAutoConfiguration {
// tracing
camelContext.setTracing(config.isTracing());
- if (camelContext.getDefaultTracer() instanceof Tracer) {
- Tracer tracer = (Tracer) camelContext.getDefaultTracer();
- if (tracer.getDefaultTraceFormatter() != null) {
- DefaultTraceFormatter formatter = tracer.getDefaultTraceFormatter();
- if (config.getTracerFormatterBreadCrumbLength() != null) {
- formatter.setBreadCrumbLength(config.getTracerFormatterBreadCrumbLength());
- }
- if (config.getTracerFormatterMaxChars() != null) {
- formatter.setMaxChars(config.getTracerFormatterMaxChars());
- }
- if (config.getTracerFormatterNodeLength() != null) {
- formatter.setNodeLength(config.getTracerFormatterNodeLength());
- }
- formatter.setShowBody(config.isTraceFormatterShowBody());
- formatter.setShowBodyType(config.isTracerFormatterShowBodyType());
- formatter.setShowBreadCrumb(config.isTraceFormatterShowBreadCrumb());
- formatter.setShowException(config.isTraceFormatterShowException());
- formatter.setShowExchangeId(config.isTraceFormatterShowExchangeId());
- formatter.setShowExchangePattern(config.isTraceFormatterShowExchangePattern());
- formatter.setShowHeaders(config.isTraceFormatterShowHeaders());
- formatter.setShowNode(config.isTraceFormatterShowNode());
- formatter.setShowProperties(config.isTraceFormatterShowProperties());
- formatter.setShowRouteId(config.isTraceFormatterShowRouteId());
- formatter.setShowShortExchangeId(config.isTraceFormatterShowShortExchangeId());
- }
- }
if (config.getXmlRoutesReloadDirectory() != null) {
ReloadStrategy reload = new FileWatcherReloadStrategy(config.getXmlRoutesReloadDirectory());
@@ -370,17 +341,6 @@ public class CamelAutoConfiguration {
* Similar code in camel-core-xml module in class org.apache.camel.core.xml.AbstractCamelContextFactoryBean.
*/
static void afterPropertiesSet(ApplicationContext applicationContext, CamelContext camelContext) throws Exception {
- Tracer tracer = getSingleBeanOfType(applicationContext, Tracer.class);
- if (tracer != null) {
- // use formatter if there is a TraceFormatter bean defined
- TraceFormatter formatter = getSingleBeanOfType(applicationContext, TraceFormatter.class);
- if (formatter != null) {
- tracer.setFormatter(formatter);
- }
- LOG.info("Using custom Tracer: {}", tracer);
- camelContext.addInterceptStrategy(tracer);
- }
-
final ManagementStrategy managementStrategy = camelContext.getManagementStrategy();
registerPropertyForBeanType(applicationContext, BacklogTracer.class, camelContext::addInterceptStrategy);
diff --git a/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/TracerConfigurationTest.java b/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/TracerConfigurationTest.java
deleted file mode 100644
index 3b8c94c..0000000
--- a/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/TracerConfigurationTest.java
+++ /dev/null
@@ -1,45 +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.spring.interceptor;
-
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.spring.SpringTestSupport;
-import org.junit.Test;
-import org.springframework.context.support.AbstractXmlApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
-
-/**
- * Unit test for tracer configuration configured in spring XML.
- */
-public class TracerConfigurationTest extends SpringTestSupport {
-
- protected AbstractXmlApplicationContext createApplicationContext() {
- return new ClassPathXmlApplicationContext(
- "/org/apache/camel/spring/interceptor/tracerConfigurationTest.xml");
- }
-
- @Test
- public void testTraceFormatter() throws Exception {
- MockEndpoint mock = getMockEndpoint("mock:result");
- mock.expectedMessageCount(1);
-
- template.sendBody("direct:start", "Hello World");
-
- assertMockEndpointsSatisfied();
- }
-
-}
\ No newline at end of file
diff --git a/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringDefaultErrorHandlerOnExceptionTraceTest.java b/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringDefaultErrorHandlerOnExceptionTraceTest.java
deleted file mode 100644
index b5935e6..0000000
--- a/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringDefaultErrorHandlerOnExceptionTraceTest.java
+++ /dev/null
@@ -1,35 +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.spring.processor;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.processor.DefaultErrorHandlerOnExceptionTraceTest;
-
-import static org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext;
-
-public class SpringDefaultErrorHandlerOnExceptionTraceTest extends DefaultErrorHandlerOnExceptionTraceTest {
-
- @Override
- public boolean isUseRouteBuilder() {
- return false;
- }
-
- protected CamelContext createCamelContext() throws Exception {
- return createSpringCamelContext(this, "org/apache/camel/spring/processor/SpringDefaultErrorHandlerOnExceptionTraceTest.xml");
- }
-
-}
\ No newline at end of file
diff --git a/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringInterceptSimpleRouteTraceTest.java b/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringInterceptSimpleRouteTraceTest.java
deleted file mode 100644
index d43c5e2..0000000
--- a/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringInterceptSimpleRouteTraceTest.java
+++ /dev/null
@@ -1,35 +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.spring.processor;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.processor.intercept.InterceptSimpleRouteTraceTest;
-
-import static org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext;
-
-public class SpringInterceptSimpleRouteTraceTest extends InterceptSimpleRouteTraceTest {
-
- @Override
- public boolean isUseRouteBuilder() {
- return false;
- }
-
- protected CamelContext createCamelContext() throws Exception {
- return createSpringCamelContext(this, "org/apache/camel/spring/processor/SpringInterceptSimpleRouteTraceTest.xml");
- }
-
-}
\ No newline at end of file
diff --git a/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringOnCompletionGlobalTraceTest.java b/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringOnCompletionGlobalTraceTest.java
deleted file mode 100644
index 3ae31bd..0000000
--- a/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringOnCompletionGlobalTraceTest.java
+++ /dev/null
@@ -1,35 +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.spring.processor;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.processor.OnCompletionGlobalTraceTest;
-
-import static org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext;
-
-public class SpringOnCompletionGlobalTraceTest extends OnCompletionGlobalTraceTest {
-
- @Override
- public boolean isUseRouteBuilder() {
- return false;
- }
-
- protected CamelContext createCamelContext() throws Exception {
- return createSpringCamelContext(this, "org/apache/camel/spring/processor/SpringOnCompletionGlobalTraceTest.xml");
- }
-
-}
\ No newline at end of file
diff --git a/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringTraceInterceptorWithOutBodyTraceTest.java b/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringTraceInterceptorWithOutBodyTraceTest.java
deleted file mode 100644
index 6ce0502..0000000
--- a/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringTraceInterceptorWithOutBodyTraceTest.java
+++ /dev/null
@@ -1,29 +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.spring.processor;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.processor.TraceInterceptorWithOutBodyTraceTest;
-
-import static org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext;
-
-public class SpringTraceInterceptorWithOutBodyTraceTest extends TraceInterceptorWithOutBodyTraceTest {
- protected CamelContext createCamelContext() throws Exception {
- return createSpringCamelContext(this, "org/apache/camel/spring/processor/traceInterceptorWithOutBodyTrace.xml");
- }
-}
diff --git a/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringTracePerRouteTest.java b/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringTracePerRouteTest.java
deleted file mode 100644
index ae2b1c4..0000000
--- a/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringTracePerRouteTest.java
+++ /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.
- */
-package org.apache.camel.spring.processor;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.processor.TracePerRouteTest;
-
-import static org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext;
-
-/**
- * @version
- */
-public class SpringTracePerRouteTest extends TracePerRouteTest {
-
- protected CamelContext createCamelContext() throws Exception {
- return createSpringCamelContext(this, "org/apache/camel/spring/processor/traceperroute.xml");
- }
-}
\ No newline at end of file
diff --git a/components/camel-spring/src/test/java/org/apache/camel/spring/processor/tracing/SpringTraceInitIdOnAllNodesTest.java b/components/camel-spring/src/test/java/org/apache/camel/spring/processor/tracing/SpringTraceInitIdOnAllNodesTest.java
deleted file mode 100644
index 68d44a7..0000000
--- a/components/camel-spring/src/test/java/org/apache/camel/spring/processor/tracing/SpringTraceInitIdOnAllNodesTest.java
+++ /dev/null
@@ -1,33 +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.spring.processor.tracing;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.processor.interceptor.TraceInitIdOnAllNodesTest;
-
-import static org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext;
-
-/**
- *
- */
-public class SpringTraceInitIdOnAllNodesTest extends TraceInitIdOnAllNodesTest {
-
- protected CamelContext createCamelContext() throws Exception {
- return createSpringCamelContext(this, "org/apache/camel/spring/processor/tracing/SpringTraceInitIdOnAllNodesTest.xml");
- }
-
-}
diff --git a/components/camel-spring/src/test/java/org/apache/camel/spring/processor/tracing/TraceHandlerTest.java b/components/camel-spring/src/test/java/org/apache/camel/spring/processor/tracing/TraceHandlerTest.java
deleted file mode 100644
index 2be3d98..0000000
--- a/components/camel-spring/src/test/java/org/apache/camel/spring/processor/tracing/TraceHandlerTest.java
+++ /dev/null
@@ -1,28 +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.spring.processor.tracing;
-
-import org.springframework.context.support.AbstractXmlApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
-
-public class TraceHandlerTest extends TracingTestBase {
-
- @Override
- protected AbstractXmlApplicationContext createApplicationContext() {
- return new ClassPathXmlApplicationContext("org/apache/camel/spring/processor/tracing/traceHandlerTestContext.xml");
- }
-}
diff --git a/components/camel-spring/src/test/java/org/apache/camel/spring/processor/tracing/TraceInterceptorCustomJpaMessageTest.java b/components/camel-spring/src/test/java/org/apache/camel/spring/processor/tracing/TraceInterceptorCustomJpaMessageTest.java
deleted file mode 100644
index 45d3499..0000000
--- a/components/camel-spring/src/test/java/org/apache/camel/spring/processor/tracing/TraceInterceptorCustomJpaMessageTest.java
+++ /dev/null
@@ -1,53 +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.spring.processor.tracing;
-
-import org.apache.camel.Exchange;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.processor.interceptor.TraceInterceptorCustomJpaMessage;
-import org.springframework.context.support.AbstractXmlApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
-
-public class TraceInterceptorCustomJpaMessageTest extends TracingTestBase {
-
- @Override
- protected AbstractXmlApplicationContext createApplicationContext() {
- return new ClassPathXmlApplicationContext("org/apache/camel/spring/processor/tracing/traceInterceptorCustomJpaMessageContext.xml");
- }
-
- @Override
- protected void prepareTestTracerExceptionInOut() {
- MockEndpoint traces = getMockEndpoint("mock:jpa-trace");
- traces.expectedMessageCount(14);
- }
-
- @Override
- protected void validateTestTracerExceptionInOut() {
- MockEndpoint traces = getMockEndpoint("mock:jpa-trace");
- assertEquals(14, traces.getExchanges().size());
- for (Exchange exchange : traces.getExchanges()) {
- assertEquals(exchange.getIn().getBody().getClass(), TraceInterceptorCustomJpaMessage.class);
- }
- }
-
- @Override
- protected int getMessageCount() {
- MockEndpoint traces = getMockEndpoint("mock:jpa-trace");
- return traces.getExchanges().size();
- }
-
-}
diff --git a/components/camel-spring/src/test/java/org/apache/camel/spring/processor/tracing/TraceInterceptorSubclassTest.java b/components/camel-spring/src/test/java/org/apache/camel/spring/processor/tracing/TraceInterceptorSubclassTest.java
deleted file mode 100644
index 29d603f..0000000
--- a/components/camel-spring/src/test/java/org/apache/camel/spring/processor/tracing/TraceInterceptorSubclassTest.java
+++ /dev/null
@@ -1,37 +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.spring.processor.tracing;
-
-import java.util.List;
-
-import org.springframework.context.support.AbstractXmlApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
-
-public class TraceInterceptorSubclassTest extends TracingTestBase {
-
- @Override
- protected AbstractXmlApplicationContext createApplicationContext() {
- return new ClassPathXmlApplicationContext("org/apache/camel/spring/processor/tracing/traceInterceptorSubclassContext.xml");
- }
-
- @SuppressWarnings("unchecked")
- @Override
- protected List<StringBuilder> getTracedMessages() {
- return this.applicationContext.getBean("eventMessages", List.class);
- }
-
-}
\ No newline at end of file
diff --git a/components/camel-spring/src/test/java/org/apache/camel/spring/processor/tracing/TracingTestBase.java b/components/camel-spring/src/test/java/org/apache/camel/spring/processor/tracing/TracingTestBase.java
deleted file mode 100644
index 46428ed..0000000
--- a/components/camel-spring/src/test/java/org/apache/camel/spring/processor/tracing/TracingTestBase.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.spring.processor.tracing;
-
-import java.util.List;
-
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.processor.interceptor.TraceHandlerTestHandler;
-import org.apache.camel.processor.interceptor.Tracer;
-import org.apache.camel.spring.SpringTestSupport;
-import org.junit.Test;
-
-public abstract class TracingTestBase extends SpringTestSupport {
-
- protected List<StringBuilder> getTracedMessages() {
- Tracer tracer = this.applicationContext.getBean("tracer", Tracer.class);
- TraceHandlerTestHandler handler = (TraceHandlerTestHandler) tracer.getTraceHandlers().get(0);
- return handler.getEventMessages();
- }
-
- protected void prepareTestTracerExceptionInOut() {
- }
-
- protected void validateTestTracerExceptionInOut() {
- List<StringBuilder> tracedMessages = getTracedMessages();
- assertEquals(7, tracedMessages.size());
- for (StringBuilder tracedMessage : tracedMessages) {
- String message = tracedMessage.toString();
- assertTrue(message.startsWith("In"));
- assertTrue(message.contains("Out:"));
- }
- assertTrue(tracedMessages.get(4).toString().contains("Ex:"));
- }
-
- protected int getMessageCount() {
- return getTracedMessages().size();
- }
-
- @Test
- public void testTracerExceptionInOut() throws Exception {
- MockEndpoint result = getMockEndpoint("mock:result");
- ((Tracer) context.getDefaultTracer()).setTraceOutExchanges(true);
- result.expectedMessageCount(3);
- prepareTestTracerExceptionInOut();
-
- template.sendBody("direct:start", "Hello World");
- template.sendBody("direct:start", "Bye World");
- try {
- template.sendBody("direct:start", "Kaboom");
- fail("Should have thrown exception");
- } catch (Exception e) {
- // expected
- }
- template.sendBody("direct:start", "Hello Camel");
-
- assertMockEndpointsSatisfied();
-
- validateTestTracerExceptionInOut();
- }
-}
diff --git a/components/camel-spring/src/test/resources/org/apache/camel/spring/interceptor/traceFormatterTest.xml b/components/camel-spring/src/test/resources/org/apache/camel/spring/interceptor/traceFormatterTest.xml
deleted file mode 100644
index e127d84..0000000
--- a/components/camel-spring/src/test/resources/org/apache/camel/spring/interceptor/traceFormatterTest.xml
+++ /dev/null
@@ -1,43 +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
- ">
-
- <!-- START SNIPPET: e1 -->
- <bean id="traceFormatter" class="org.apache.camel.processor.interceptor.DefaultTraceFormatter">
- <property name="showBody" value="true"/>
- <property name="showBodyType" value="false"/>
- <property name="showBreadCrumb" value="false"/>
- <property name="maxChars" value="100"/>
- </bean>
-
- <camelContext trace="true" xmlns="http://camel.apache.org/schema/spring">
- <route>
- <from uri="direct:start"/>
- <to uri="mock:result"/>
- </route>
- </camelContext>
- <!-- END SNIPPET: e1 -->
-
-</beans>
diff --git a/components/camel-spring/src/test/resources/org/apache/camel/spring/interceptor/tracerConfigurationTest.xml b/components/camel-spring/src/test/resources/org/apache/camel/spring/interceptor/tracerConfigurationTest.xml
deleted file mode 100644
index 183167b..0000000
--- a/components/camel-spring/src/test/resources/org/apache/camel/spring/interceptor/tracerConfigurationTest.xml
+++ /dev/null
@@ -1,45 +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
- ">
-
- <!-- START SNIPPET: e1 -->
- <!-- we can configure the tracer by defining the tracer bean and set the properties as we like -->
- <!-- the id name can be anything its the class that must be org.apache.camel.processor.interceptor.Tracer -->
- <bean id="camelTracer" class="org.apache.camel.processor.interceptor.Tracer">
- <property name="traceExceptions" value="false"/>
- <property name="traceInterceptors" value="true"/>
- <property name="logLevel" value="ERROR"/>
- <property name="logName" value="com.mycompany.messages"/>
- </bean>
-
- <camelContext trace="true" xmlns="http://camel.apache.org/schema/spring">
- <route>
- <from uri="direct:start"/>
- <to uri="mock:result"/>
- </route>
- </camelContext>
- <!-- END SNIPPET: e1 -->
-
-</beans>
diff --git a/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringDefaultErrorHandlerOnExceptionTraceTest.xml b/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringDefaultErrorHandlerOnExceptionTraceTest.xml
deleted file mode 100644
index eca828b..0000000
--- a/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringDefaultErrorHandlerOnExceptionTraceTest.xml
+++ /dev/null
@@ -1,48 +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
- ">
-
- <bean id="tracer" class="org.apache.camel.processor.interceptor.Tracer">
- <property name="destinationUri" value="mock:trace"/>
- </bean>
-
- <bean id="myProcessor" class="org.apache.camel.processor.DefaultErrorHandlerOnExceptionTraceTest$MyProcessor"/>
-
- <camelContext xmlns="http://camel.apache.org/schema/spring">
-
- <onException>
- <exception>java.lang.IllegalArgumentException</exception>
- <handled><constant>true</constant></handled>
- <to uri="log:boom"/>
- <to uri="mock:boom"/>
- </onException>
-
- <route>
- <from uri="direct:start"/>
- <process ref="myProcessor"/>
- <to uri="mock:result"/>
- </route>
- </camelContext>
-</beans>
diff --git a/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringInterceptSimpleRouteTraceTest.xml b/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringInterceptSimpleRouteTraceTest.xml
deleted file mode 100644
index 7197fe4..0000000
--- a/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringInterceptSimpleRouteTraceTest.xml
+++ /dev/null
@@ -1,44 +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
- ">
-
- <bean id="tracer" class="org.apache.camel.processor.interceptor.Tracer">
- <property name="destinationUri" value="mock:trace"/>
- </bean>
-
- <camelContext xmlns="http://camel.apache.org/schema/spring">
- <intercept>
- <to uri="mock:intercepted"/>
- </intercept>
-
- <route>
- <from uri="direct:start"/>
- <to uri="mock:foo"/>
- <to uri="mock:bar"/>
- <to uri="mock:result"/>
- </route>
- </camelContext>
-
-</beans>
diff --git a/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringOnCompletionGlobalTraceTest.xml b/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringOnCompletionGlobalTraceTest.xml
deleted file mode 100644
index 198c3f6..0000000
--- a/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringOnCompletionGlobalTraceTest.xml
+++ /dev/null
@@ -1,45 +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
- ">
-
- <bean id="tracer" class="org.apache.camel.processor.interceptor.Tracer">
- <property name="destinationUri" value="mock:trace"/>
- </bean>
-
- <bean id="myProcessor" class="org.apache.camel.processor.OnCompletionTest$MyProcessor"/>
-
- <camelContext xmlns="http://camel.apache.org/schema/spring">
- <onCompletion>
- <to uri="log:global"/>
- <to uri="mock:sync"/>
- </onCompletion>
-
- <route>
- <from uri="direct:start"/>
- <process ref="myProcessor"/>
- <to uri="mock:result"/>
- </route>
- </camelContext>
-</beans>
diff --git a/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/traceInterceptorWithOutBodyTrace.xml b/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/traceInterceptorWithOutBodyTrace.xml
deleted file mode 100644
index 848dd87..0000000
--- a/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/traceInterceptorWithOutBodyTrace.xml
+++ /dev/null
@@ -1,51 +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
- ">
-
- <!-- START SNIPPET: example -->
- <camelContext trace="true" xmlns="http://camel.apache.org/schema/spring">
- <route>
- <from uri="direct:start"/>
- <transform>
- <simple>${body}</simple>
- </transform>
- <to uri="mock:a"/>
- <to uri="mock:b"/>
- </route>
- </camelContext>
- <!-- END SNIPPET: example -->
-
- <!-- START SNIPPET: tracingOutExchanges -->
- <bean id="camelTracer" class="org.apache.camel.processor.interceptor.Tracer">
- <property name="traceOutExchanges" value="true" />
- </bean>
-
- <bean id="traceFormatter" class="org.apache.camel.processor.interceptor.DefaultTraceFormatter">
- <property name="showOutBody" value="true" />
- <property name="showOutBodyType" value="true" />
- </bean>
- <!-- END SNIPPET: tracingOutExchanges -->
-
-</beans>
diff --git a/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/traceperroute.xml b/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/traceperroute.xml
deleted file mode 100644
index a4732f8..0000000
--- a/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/traceperroute.xml
+++ /dev/null
@@ -1,47 +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
- ">
-
- <bean id="myTracer" class="org.apache.camel.processor.interceptor.Tracer">
- <property name="destinationUri" value="mock:traced"/>
- <property name="logName" value="foo"/>
- </bean>
-
- <camelContext trace="true" xmlns="http://camel.apache.org/schema/spring">
- <route>
- <from uri="direct:a"/>
- <to uri="mock:a"/>
- </route>
- <route trace="false">
- <from uri="direct:b"/>
- <to uri="mock:b"/>
- </route>
- <route trace="true">
- <from uri="direct:c"/>
- <to uri="mock:c"/>
- </route>
- </camelContext>
-
-</beans>
diff --git a/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/tracing/SpringTraceInitIdOnAllNodesTest.xml b/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/tracing/SpringTraceInitIdOnAllNodesTest.xml
deleted file mode 100644
index 0cac42c..0000000
--- a/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/tracing/SpringTraceInitIdOnAllNodesTest.xml
+++ /dev/null
@@ -1,46 +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
- ">
-
- <camelContext xmlns="http://camel.apache.org/schema/spring" trace="true">
- <route>
- <from uri="direct:start"/>
- <choice>
- <when>
- <simple>${body} contains 'Camel'</simple>
- <log message="A Camel message"/>
- <to uri="mock:camel" id="camel"/>
- </when>
- <otherwise>
- <log message="Some other kind of message"/>
- <to uri="mock:other"/>
- <to uri="mock:foo" id="foo"/>
- </otherwise>
- </choice>
- <to uri="mock:end" id="end"/>
- </route>
- </camelContext>
-
-</beans>
diff --git a/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/tracing/traceHandlerTestContext.xml b/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/tracing/traceHandlerTestContext.xml
deleted file mode 100644
index 3911461..0000000
--- a/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/tracing/traceHandlerTestContext.xml
+++ /dev/null
@@ -1,47 +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
- ">
-
- <bean id="tracer" class="org.apache.camel.processor.interceptor.Tracer">
- <property name="traceHandler">
- <bean class="org.apache.camel.processor.interceptor.TraceHandlerTestHandler">
- <property name="traceAllNodes" value="true"/>
- </bean>
- </property>
- <property name="enabled" value="true"/>
- <property name="traceOutExchanges" value="true"/>
- </bean>
-
- <bean id="TraceTestProcessor" class="org.apache.camel.processor.interceptor.TraceTestProcessor"/>
-
- <camelContext trace="true" id="camelTracingContext" xmlns="http://camel.apache.org/schema/spring">
- <route>
- <from uri="direct:start"/>
- <process ref="TraceTestProcessor"/>
- <to uri="mock:result"/>
- </route>
- </camelContext>
-
-</beans>
diff --git a/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/tracing/traceInterceptorCustomJpaMessageContext.xml b/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/tracing/traceInterceptorCustomJpaMessageContext.xml
deleted file mode 100644
index f6d4e1b..0000000
--- a/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/tracing/traceInterceptorCustomJpaMessageContext.xml
+++ /dev/null
@@ -1,46 +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
- ">
-
- <bean id="tracer" class="org.apache.camel.processor.interceptor.Tracer">
- <property name="enabled" value="true"/>
- <property name="useJpa" value="true"/>
- <property name="traceOutExchanges" value="true"/>
- <property name="destinationUri" value="mock:jpa-trace"/>
- <property name="jpaTraceEventMessageClassName"
- value="org.apache.camel.processor.interceptor.TraceInterceptorCustomJpaMessage"/>
- </bean>
-
- <bean id="TraceTestProcessor" class="org.apache.camel.processor.interceptor.TraceTestProcessor"/>
-
- <camelContext trace="true" id="camelTracingContext" xmlns="http://camel.apache.org/schema/spring">
- <route>
- <from uri="direct:start"/>
- <process ref="TraceTestProcessor"/>
- <to uri="mock:result"/>
- </route>
- </camelContext>
-
-</beans>
diff --git a/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/tracing/traceInterceptorSubclassContext.xml b/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/tracing/traceInterceptorSubclassContext.xml
deleted file mode 100644
index fd6eb60..0000000
--- a/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/tracing/traceInterceptorSubclassContext.xml
+++ /dev/null
@@ -1,50 +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
- ">
-
- <bean id="eventMessages" class="java.util.LinkedList"/>
-
- <bean id="tracer" class="org.apache.camel.processor.interceptor.Tracer">
- <property name="traceInterceptorFactory">
- <bean class="org.apache.camel.processor.interceptor.TraceInterceptorSubclassFactory">
- <constructor-arg ref="eventMessages"/>
- <property name="traceAllNodes" value="true"/>
- </bean>
- </property>
- <property name="enabled" value="true"/>
- <property name="traceOutExchanges" value="true"/>
- </bean>
-
- <bean id="TraceTestProcessor" class="org.apache.camel.processor.interceptor.TraceTestProcessor"/>
-
- <camelContext trace="true" id="camelTracingContext" xmlns="http://camel.apache.org/schema/spring">
- <route>
- <from uri="direct:start"/>
- <process ref="TraceTestProcessor"/>
- <to uri="mock:result"/>
- </route>
- </camelContext>
-
-</beans>
diff --git a/examples/camel-example-tracer/README.md b/examples/camel-example-tracer/README.md
deleted file mode 100644
index 0724ff2..0000000
--- a/examples/camel-example-tracer/README.md
+++ /dev/null
@@ -1,38 +0,0 @@
-# Tracer Example
-
-### Introduction
-This example shows how to persist Camel trace event messages into a database using JPA.
-
-### Build
-You will need to compile this example first:
-
- mvn compile
-
-### Run
-
-To run the example with Maven, type
-
- mvn camel:run
-
-In the console you can enter some words separated with space. Try to enter:
-
- nice beer
- beer whiskey
- camel nice day
-
-This example will based on the input get some quotes from the input and select the best quote
-to return as response in the console.
-
-To stop the example hit <kbd>ctrl</kbd>+<kbd>c</kbd>
-
-### Forum, Help, etc
-
-If you hit an problems please let us know on the Camel Forums
- <http://camel.apache.org/discussion-forums.html>
-
-Please help us make Apache Camel better - we appreciate any feedback you may
-have. Enjoy!
-
-
-
-The Camel riders!
diff --git a/examples/camel-example-tracer/pom.xml b/examples/camel-example-tracer/pom.xml
deleted file mode 100644
index e9e8c81..0000000
--- a/examples/camel-example-tracer/pom.xml
+++ /dev/null
@@ -1,124 +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>
- <groupId>org.apache.camel.example</groupId>
- <artifactId>examples</artifactId>
- <version>3.0.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>camel-example-tracer</artifactId>
- <packaging>jar</packaging>
- <name>Camel :: Example :: Tracer (deprecated)</name>
- <description>An example showing how to persist Camel trace event messages using JPA</description>
-
- <properties>
- <category>Management and Monitoring</category>
-
- <camel.osgi.export.pkg>org.apache.camel.example.tracer</camel.osgi.export.pkg>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-jpa</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-stream</artifactId>
- </dependency>
-
- <!-- logging -->
- <dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-api</artifactId>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-core</artifactId>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-slf4j-impl</artifactId>
- <scope>runtime</scope>
- </dependency>
-
- <!-- lets use hibernate by default -->
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-entitymanager</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.derby</groupId>
- <artifactId>derby</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jta_1.1_spec</artifactId>
- </dependency>
-
- <!-- testing -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-artifacts</id>
- <phase>package</phase>
- <goals>
- <goal>attach-artifact</goal>
- </goals>
- <configuration>
- <artifacts>
- <artifact>
- <file>target/classes/features.xml</file>
- <type>xml</type>
- <classifier>features</classifier>
- </artifact>
- </artifacts>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <!-- Allows the example to be run via 'mvn camel:run' -->
- <plugin>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-maven-plugin</artifactId>
- <version>${project.version}</version>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/examples/camel-example-tracer/src/main/java/org/apache/camel/example/tracer/FixedDerbyDialect.java b/examples/camel-example-tracer/src/main/java/org/apache/camel/example/tracer/FixedDerbyDialect.java
deleted file mode 100644
index f0787f7..0000000
--- a/examples/camel-example-tracer/src/main/java/org/apache/camel/example/tracer/FixedDerbyDialect.java
+++ /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.
- */
-package org.apache.camel.example.tracer;
-
-import java.sql.Types;
-
-import org.hibernate.dialect.DerbyDialect;
-
-/**
- * See https://hibernate.onjira.com/browse/HHH-7264 for details
- *
- */
-public class FixedDerbyDialect extends DerbyDialect {
-
- public FixedDerbyDialect() {
- registerColumnType(Types.CLOB, "clob");
- }
-}
diff --git a/examples/camel-example-tracer/src/main/java/org/apache/camel/example/tracer/Main.java b/examples/camel-example-tracer/src/main/java/org/apache/camel/example/tracer/Main.java
deleted file mode 100644
index 3a28567..0000000
--- a/examples/camel-example-tracer/src/main/java/org/apache/camel/example/tracer/Main.java
+++ /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.
- */
-package org.apache.camel.example.tracer;
-
-/**
- * To start the application from ANT
- */
-public final class Main {
-
- private Main() {
- // do nothing here
- }
-
- public static void main(String[] args) throws Exception {
- org.apache.camel.spring.Main.main(args);
- }
-
-}
diff --git a/examples/camel-example-tracer/src/main/java/org/apache/camel/example/tracer/QuoteAggregator.java b/examples/camel-example-tracer/src/main/java/org/apache/camel/example/tracer/QuoteAggregator.java
deleted file mode 100644
index 36e63e1..0000000
--- a/examples/camel-example-tracer/src/main/java/org/apache/camel/example/tracer/QuoteAggregator.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.example.tracer;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-import org.apache.camel.Exchange;
-import org.apache.camel.processor.aggregate.AggregationStrategy;
-
-/**
- * Our aggregator where we aggregate all the quotes and find the
- * the best quotes based on the one that has the most cool words
- * from our cools words list
- */
-public class QuoteAggregator implements AggregationStrategy {
-
- private List<String> coolWords = new ArrayList<>();
-
- public void setCoolWords(List<String> coolWords) {
- for (String s : coolWords) {
- // use lower case to be case insensitive
- this.coolWords.add(s.toLowerCase());
- }
- // reverse order so indexOf returning -1 will be the last instead
- Collections.reverse(this.coolWords);
- }
-
- public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
- if (oldExchange == null) {
- // the first time then just return the new exchange
- return newExchange;
- }
-
- // here we aggregate
- // oldExchange is the current "winner"
- // newExchange is the new candidate
-
- // we get the quotes of the two exchanges
- String oldQuote = oldExchange.getIn().getBody(String.class);
- String newQuote = newExchange.getIn().getBody(String.class);
-
- // now we compare the two and get a result indicate the best one
- int result = new QuoteComparator().compare(oldQuote, newQuote);
-
- // we return the winner
- return result > 0 ? newExchange : oldExchange;
- }
-
- private class QuoteComparator implements Comparator<String> {
-
- public int compare(java.lang.String o1, java.lang.String o2) {
- // here we compare the two quotes and picks the one that
- // is in the top of the cool words list
- int index1 = coolWords.indexOf(o1.toLowerCase());
- int index2 = coolWords.indexOf(o2.toLowerCase());
-
- return index1 - index2;
- }
- }
-
-}
diff --git a/examples/camel-example-tracer/src/main/java/org/apache/camel/example/tracer/QuoteService.java b/examples/camel-example-tracer/src/main/java/org/apache/camel/example/tracer/QuoteService.java
deleted file mode 100644
index 8f34b1b..0000000
--- a/examples/camel-example-tracer/src/main/java/org/apache/camel/example/tracer/QuoteService.java
+++ /dev/null
@@ -1,47 +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.example.tracer;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-/**
- * Our quote server that can split words and lookup a quote based on a word
- */
-public class QuoteService {
-
- private List<String> quotes = new ArrayList<>();
-
- public void setQuotes(List<String> quotes) {
- this.quotes = quotes;
- }
-
- public String quote(String text) {
- for (String s : quotes) {
- if (s.toLowerCase().contains(text.toLowerCase())) {
- return s;
- }
- }
- return "No quote found for the input: " + text;
- }
-
- public List<String> splitWords(String payload) {
- return Arrays.asList(payload.split(" "));
- }
-
-}
diff --git a/examples/camel-example-tracer/src/main/resources/META-INF/LICENSE.txt b/examples/camel-example-tracer/src/main/resources/META-INF/LICENSE.txt
deleted file mode 100644
index 6b0b127..0000000
--- a/examples/camel-example-tracer/src/main/resources/META-INF/LICENSE.txt
+++ /dev/null
@@ -1,203 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
diff --git a/examples/camel-example-tracer/src/main/resources/META-INF/NOTICE.txt b/examples/camel-example-tracer/src/main/resources/META-INF/NOTICE.txt
deleted file mode 100644
index 2e215bf..0000000
--- a/examples/camel-example-tracer/src/main/resources/META-INF/NOTICE.txt
+++ /dev/null
@@ -1,11 +0,0 @@
- =========================================================================
- == NOTICE file corresponding to the section 4 d of ==
- == the Apache License, Version 2.0, ==
- == in this case for the Apache Camel distribution. ==
- =========================================================================
-
- This product includes software developed by
- The Apache Software Foundation (http://www.apache.org/).
-
- Please read the different LICENSE files present in the licenses directory of
- this distribution.
diff --git a/examples/camel-example-tracer/src/main/resources/META-INF/persistence.xml b/examples/camel-example-tracer/src/main/resources/META-INF/persistence.xml
deleted file mode 100644
index 3f3e19c..0000000
--- a/examples/camel-example-tracer/src/main/resources/META-INF/persistence.xml
+++ /dev/null
@@ -1,41 +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.
-
--->
-<!-- START SNIPPET: e1 -->
-<persistence xmlns="http://java.sun.com/xml/ns/persistence"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- version="1.0">
-
- <persistence-unit name="tracer" transaction-type="RESOURCE_LOCAL">
- <class>org.apache.camel.processor.interceptor.jpa.JpaTraceEventMessage</class>
-
- <properties>
- <property name="hibernate.dialect" value="org.apache.camel.example.tracer.FixedDerbyDialect"/>
- <property name="hibernate.connection.driver_class" value="org.apache.derby.jdbc.EmbeddedDriver"/>
- <property name="hibernate.connection.url" value="jdbc:derby:target/derby;create=true"/>
- <property name="hibernate.hbm2ddl.auto" value="create"/>
-
- <!-- debugging flags -->
- <!-- <property name="hibernate.show_sql" value="true"/>
- <property name="hibernate.format_sql" value="true"/> -->
- </properties>
-
- </persistence-unit>
-</persistence>
- <!-- END SNIPPET: e1 -->
diff --git a/examples/camel-example-tracer/src/main/resources/META-INF/spring/camel-context.xml b/examples/camel-example-tracer/src/main/resources/META-INF/spring/camel-context.xml
deleted file mode 100644
index e7a057b..0000000
--- a/examples/camel-example-tracer/src/main/resources/META-INF/spring/camel-context.xml
+++ /dev/null
@@ -1,120 +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">
-
- <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
- <!-- START SNIPPET: e3 -->
- <endpoint id="traced" uri="jpa://org.apache.camel.processor.interceptor.JpaTraceEventMessage?persistenceUnit=tracer"/>
- <!-- END SNIPPET: e3 -->
-
- <!-- START SNIPPET: e4 -->
- <route>
- <!-- in stream to allow you to enter some text in the console -->
- <from uri="stream:in?initialPromptDelay=4000&promptDelay=2000&promptMessage=Enter some words:"/>
-
- <!-- split the text -->
- <split>
- <!-- use methodCall expression to split the words, using a java bean to do it -->
- <method bean="quoteService" method="splitWords"/>
-
- <!-- for each split message invoke the quote server to get a quote of the word -->
- <to uri="bean:quoteService?method=quote"/>
-
- <!-- now we need to find the best quote, so we aggregate all the splitted words
- we use our own strategy how to aggregate -->
- <aggregate strategyRef="myAggregateStrategy">
- <!-- correlate everything using constant true, as they are all from the same source -->
- <correlationExpression>
- <constant>true</constant>
- </correlationExpression>
- <!-- complete after 1 sec on inactivity -->
- <completionTimeout>
- <constant>1000</constant>
- </completionTimeout>
- <!-- send the result to stream out so we can see the response in the console -->
- <to uri="stream:out"/>
- </aggregate>
- </split>
- </route>
- <!-- END SNIPPET: e4 -->
-
- </camelContext>
-
- <!-- this is our aggregation strategy where we find the best quote -->
- <bean id="myAggregateStrategy" class="org.apache.camel.example.tracer.QuoteAggregator">
- <property name="coolWords">
- <list value-type="java.lang.String">
- <value>whiskey</value>
- <value>beer</value>
- <value>Camel</value>
- <value>cool</value>
- <value>great</value>
- </list>
- </property>
- </bean>
-
- <!-- our quote server with some quotes to start with -->
- <bean id="quoteService" class="org.apache.camel.example.tracer.QuoteService">
- <property name="quotes">
- <list value-type="java.lang.String">
- <value>Camel is cool</value>
- <value>We like beer</value>
- <value>Have a great day</value>
- <value>Whiskey in the jar</value>
- <value>The day that newer comes</value>
- <value>What a cold day</value>
- </list>
- </property>
- </bean>
-
- <!-- START SNIPPET: e1 -->
- <!-- use camel jpa trace so we can see all the traced exchanges in a database -->
- <bean id="camelTracer" class="org.apache.camel.processor.interceptor.Tracer">
- <!-- turn on jpa tracing, otherwise the TraceEventMessage is a non JPA Entity class -->
- <property name="useJpa" value="true"/>
- <!-- the destination to send the traced messages -->
- <property name="destination" ref="traced"/>
- <!-- we turn ordinary trace logging off so we only see the traced messages in the database,
- but you can have both if you like -->
- <property name="logLevel" value="OFF"/>
- </bean>
- <!-- END SNIPPET: e1 -->
-
- <!-- START SNIPPET: e2 -->
- <!-- this is ordinary JPA spring configuration -->
- <bean id="transactionTemplate" class="org.springframework.transaction.support.TransactionTemplate">
- <property name="transactionManager">
- <bean class="org.springframework.orm.jpa.JpaTransactionManager">
- <property name="entityManagerFactory" ref="entityManagerFactory"/>
- </bean>
- </property>
- </bean>
-
- <!-- this is ordinary JPA spring configuration -->
- <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean">
- <!-- we have named our presistence unit tracer in the META-INF/persistence.xml file -->
- <property name="persistenceUnitName" value="tracer"/>
- </bean>
- <!-- END SNIPPET: e2 -->
-</beans>
diff --git a/examples/camel-example-tracer/src/main/resources/features.xml b/examples/camel-example-tracer/src/main/resources/features.xml
deleted file mode 100644
index 68bf3e3..0000000
--- a/examples/camel-example-tracer/src/main/resources/features.xml
+++ /dev/null
@@ -1,46 +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.
-
--->
-<features>
- <repository>mvn:org.apache.camel.karaf/apache-camel/${project.version}/xml/features</repository>
-
- <feature name="jpa-hibernate" version="${project.version}">
- <bundle>mvn:org.apache.geronimo.specs/geronimo-jpa_2.1_spec/${geronimo-jpa-spec-version}</bundle>
- <bundle>mvn:org.springframework/spring-jdbc/${spring-version}</bundle>
- <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.dom4j/1.6.1_2</bundle>
- <bundle>mvn:org.antlr/com.springsource.antlr/2.7.7</bundle>
- <bundle>mvn:org.objectweb.asm/com.springsource.org.objectweb.asm/1.5.3</bundle>
- <bundle>mvn:net.sourceforge.cglib/com.springsource.net.sf.cglib/2.2.0</bundle>
- <bundle>mvn:org.jboss.javassist/com.springsource.javassist/3.9.0.GA</bundle>
- <bundle>mvn:org.hibernate/com.springsource.org.hibernate.annotations.common/3.3.0.ga</bundle>
- <bundle>mvn:org.hibernate/com.springsource.org.hibernate.annotations/3.4.0.GA</bundle>
- <bundle>mvn:org.hibernate/com.springsource.org.hibernate.ejb/3.4.0.GA</bundle>
- <bundle>mvn:org.hibernate/com.springsource.org.hibernate/3.3.2.GA</bundle>
- <bundle>mvn:org.springframework/spring-orm/${spring-version}</bundle>
- </feature>
-
- <feature name="camel-example-tracer" version="${project.version}">
- <feature version="${project.version}">camel</feature>
- <feature version="${project.version}">camel-jpa</feature>
- <feature version="${project.version}">camel-stream</feature>
... 46 lines suppressed ...