Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

We want to debug the following route TODO: e2

Wiki Markup
{snippet:id=e2|lang=java|url=camel/trunk/components/camel-test/src/test/java/org/apache/camel/test/patterns/DebugTest.java}

Which can easily done by overriding the debugBefore method as shown TODO: e1

Wiki Markup
{snippet:id=e1|lang=java|url=camel/trunk/components/camel-test/src/test/java/org/apache/camel/test/patterns/DebugTest.java}

Then from your Java editor just add a breakpoint inside the debugBefore method. Then fire up the unit test and wait for the Java editor to hit the breakpoint. Then you can inspect the Exchange during debugging while it advances during routing. The ProcessorDefinition and the id and shortName parameters is all information which tells you where in the route the breakpoint was hit.

Tip

There is also a debugAfter method which is invoked after the processor has been invoked. This allows you to see what happens to the Exchange right after it has invoked a processor in the route.

See Also