@Override
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
CronScheduledRoutePolicy policy = new CronScheduledRoutePolicy();
policy.setRouteStartTime("* 0/2 * * * ?");
policy.setRouteStopTime("* 1/2 * * * ?");
policy.setRouteStopGracePeriod(250);
policy.setTimeUnit(TimeUnit.SECONDS);
from(ftp)
.noAutoStartup().routePolicy(policy).shutdownRunningTask(ShutdownRunningTask.CompleteAllTasks)
.log("Processing ${file:name}")
.to("log:done");