Debugger has been edited by James Strachan (May 21, 2008).

(View changes)

Content:

Debugger

Camel supports a debugger framework so that tooling can be developed to easily monitor Camel routes, trace messages and set breakpoints at points in a route etc.

The Debugger is an InterceptStrategy which can be applied to a DefaultCamelContext or SpringCamelContext to ensure that there is a DebugInterceptor created for every node in the DSL.

You can grab the debugger from the CamelContext via the Debugger.getInstance() method or via the Main.getDebugger() method - which returns null if it is not enabled.

To enable debugging from the main run

java org.apache.camel.spring.Main -d

and the debugger will be active.


Programmatically using the debugger

You can use the Spring org.apache.camel.spring.Main class directly to invoke your Camel routes using a spring XML file using debug as the following test case...

// lets run the camel route in debug mode
main = new Main();
main.enableDebugging();
main.setApplicationContextUri("org/apache/camel/spring/debug/applicationContext.xml");
main.start();

// now lets test we have a debugger available
debugger = main.getDebugger();

Reply via email to