Setting breakpoints in your routes
Camel's ability to allow you to create route "recipes" (definitions) is very powerful, but it can make traditional debugging difficult. You cannot easily set a breakpoint on a line of Spring XML. Likewise, setting a breakpoint in your RouteBuilder.configure()
method will not yield the results you want as it only gets called once at startup when your route definition is parsed into a runtime route (other code).
This recipe will show you how, in your unit tests, to define methods that will be called before and after every processor step, giving you a line of Java code where you can set breakpoints to more easily debug your code.
Getting ready
The Java code for this recipe is located in the org.camelcookbook.monitoring.debug
package. The Spring XML files are located under src/main/resources/META-INF/spring
and prefixed with debug
.
This recipe's instructions assume that you have an existing route definition that you are trying to debug. Within...