I was able to stop the route finally. What I did was - 1. set sendEmptyMessageWhenIdle=true in the file component. So when all files from input folder are read and moved to backup folder, it sends empty message. 2. On empty body, I am calling a processor. 3. And in processor, I am again checking if the folder is empty and then using exchange.getContext().stopRoute("inputFiles", 5, TimeUnit.SECONDS); to stop the route.
Now the route is stopped until the next scheduled time. :) Thanks for your inputs. -- View this message in context: http://camel.465427.n5.nabble.com/Stop-polling-the-input-folder-after-the-scheduled-route-is-completed-tp5794516p5794540.html Sent from the Camel - Users mailing list archive at Nabble.com.