...
See Tracer Example for complete documentation and how to use this feature.
Traced route path during runtime
Available as of Camel 2.0
Tracer also traces the actual route path taken during runtime. Camel will store the route path taken on the UnitOfWork when Tracer is enabled.
The example below demonstrates how we can use that for error handling where we can determine at which node in the route graph the error triggered.
First we define our route:
Wiki Markup |
---|
{snippet:id=e1|lang=java|url=camel/trunk/camel-core/src/test/java/org/apache/camel/processor/TraceableUnitOfWorkTest.java} |
And then our custom error processor where we can handle the exception and figure out at which node the exception occurred.
Wiki Markup |
---|
{snippet:id=e2|lang=java|url=camel/trunk/camel-core/src/test/java/org/apache/camel/processor/TraceableUnitOfWorkTest.java} |