-
1. Re: Debugging Camel Routes in Eclipse
davsclaus Sep 16, 2010 12:01 PM (in response to jkrozak)Its just java code, so if you do set a breakpoint inside your java code in a custom Processor then it should hit it.
Can you do a system out println in the processor and make sure it prints that. Then set a breakpoint on it, and run it in debug mode.
-
2. Re: Debugging Camel Routes in Eclipse
jkrozak Sep 16, 2010 12:09 PM (in response to davsclaus)Yes, i did just that - did a System.out.println from within the Process, which works fine. Then I set a breakpoint on that same println and never hit it. Is this a case of the route being multithreaded and I need to do something to jump over to it somehow?
-
3. Re: Debugging Camel Routes in Eclipse
davsclaus Sep 16, 2010 12:46 PM (in response to jkrozak)No it must be eclipse not being able to align source code when debugging.
So when you set a break point on line XXX in src file, it cannot align that. How do you start the Camel from Eclipse?
-
4. Re: Debugging Camel Routes in Eclipse
jkrozak Sep 16, 2010 3:35 PM (in response to davsclaus)I start the route from a regular Java console application as follows. Each Processor has code that i want to step through in the debugger. When i set a breakpoint in Processor1, i never reach it and when i continue the run within the debugger, the route never seems to complete:
public static void main(String[] args)
{
try
{
CamelContext context = new DefaultCamelContext();
context.setTracing(true);
context.addRoutes(
new RouteBuilder()
{
public void configure()
{
from ("file:src/main/resources/messages/src?noop=true").
process(new Processor1()).
process(new Processor2()).
process(new Processor3()).
to ("file:src/main/resources/messages/dest");
}
}
);
// Start the route...
context.start();
Thread.sleep(60000);
// Stop the CamelContext
context.stop();
...
-
5. Re: Debugging Camel Routes in Eclipse
davsclaus Sep 17, 2010 1:31 AM (in response to jkrozak)Well that is odd. Try setting a break point in the main method to see if it can debug there.
And make sure you compile with debug info turned on.