Skip to content

Commit

Permalink
CAMEL-619: Fixed tracer not outputting node ids. Added unit test for …
Browse files Browse the repository at this point in the history
…tracer. Breadcrum is outputtet to be used for correlation for poor end users looking into the log files

git-svn-id: https://svn.apache.org/repos/asf/activemq/camel/trunk@671765 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
davsclaus committed Jun 26, 2008
1 parent 5436a23 commit a7a75d0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Expand Up @@ -27,6 +27,7 @@
*/
public class DebugInterceptorTest extends ContextTestSupport {

// START SNIPPET: e1
public void testSendingSomeMessages() throws Exception {
template.sendBodyAndHeader("direct:start", "Hello London", "to", "James");
template.sendBodyAndHeader("direct:start", "This is Copenhagen calling", "from", "Claus");
Expand All @@ -35,6 +36,9 @@ public void testSendingSomeMessages() throws Exception {
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
public void configure() throws Exception {
// add debugger as an interceptor. The debugger is an enhanced tracer that also
// logs the exchanges at runtime. It is also a framework where we programatically
// can access the internal states of Camel etc.
getContext().addInterceptStrategy(new Debugger());

from("direct:start").
Expand All @@ -53,5 +57,6 @@ public String toString() {
}
};
}
// END SNIPPET: e1

}
Expand Up @@ -28,6 +28,7 @@
*/
public class TraceInterceptorTest extends ContextTestSupport {

// START SNIPPET: e1
public void testSendingSomeMessages() throws Exception {
template.sendBodyAndHeader("direct:start", "Hello London", "to", "James");
template.sendBodyAndHeader("direct:start", "This is Copenhagen calling", "from", "Claus");
Expand All @@ -36,6 +37,8 @@ public void testSendingSomeMessages() throws Exception {
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
public void configure() throws Exception {
// add tracer as an interceptor so it will log the exchange executions at runtime
// this can aid us to understand/see how the exchanges is routed etc.
getContext().addInterceptStrategy(new Tracer());

from("direct:start").
Expand All @@ -54,5 +57,6 @@ public String toString() {
}
};
}

// END SNIPPET: e1

}

0 comments on commit a7a75d0

Please sign in to comment.