However, it seems to be resolved. Thanks Petter for your help. I am using ControlBus for the switching. But while using it, routes were not getting resumed by
producerTemplate.sendBody("controlbus:route?routeId=" + routeId + "&action=resume", null);
Found that we need to add the below snippet too while resuming (dont know if this is a right way to do)
producerTemplate.sendBody("controlbus:route?routeId=" + routeId + "&action=resume", null);
camelContext().getRoute(routeId).getConsumer().start();
Otherwise it had two problems,
- Resume command was not working using ControlBus mechanism, though as per the camel log, it said that ControlBus has successfully resumed route. (but adding new file to consumer endpoint make no effect on route)
- Camel was ignoring previous files too. Say, there are more than one file when route is started, then it was only picking up the first file, then goes suspended and then (when resume invoked) got silent.