0
votes

I have a couple of Apache Camel routes created using the Java DSL and Spring.

@Bean
public CamelContext camelContext() throws Exception {
    CamelContext camelContext = new DefaultCamelContext();
    camelContext.addRoutes(route1bean());
    ...
    camelContext.start();
    return camelContext;
}

These routes use quartz2 component for scheduling and everything works as expected.

The jobs can however have errors when running and there is a requirement to retry them manually. I'm looking for a way to make adhoc manual execution of the route using hawtio or in Java code.

1

1 Answers

1
votes

Yes , use jconsole. There are many mbeans exposed by camel. You can use them to start and stop. Of course you can do the same using Hawtio as well.

Updated based on your comment:

I get what you mean, This is the approach I will take. Create 3 routes. 2 light weight routes - Route A with Simple File From endpoint, Route B with Cron and Route C with direct:bla From endpoint, which contains the actual business logic. This way, you can trigger Route A whenever you want, Route C is common, Irrespective of when Route B is triggered by the cron.