You can use controlbus to stop the rout from the route, you can do
that when the batch is complete = true so you know you have processed
all the files from the poll.

And set async=true in the controlbus in the stop

On Mon, Feb 27, 2017 at 1:51 PM, Amruta Jawlekar <[email protected]> wrote:
> Hi,
>
> I am working on a project which polls to one input folder, processes it and
> keeps the processed files to output folder. The input files are then moved
> to Backup folder.
> Now I want to keep this on scheduler twice a day at fixed time. I did that
> using CronScheduledRoutePolicy. Below is the code.
> The job runs on the scheduled hour, once all files are processed if I keep
> another files to same input folders it processes those too. Cannot use
> routeEndTime because I am not sure how much time it will take to process all
> files.
>
> How do I ask Camel to stop polling to input folder until the next scheduled
> time. I want the route to run at 12pm noon and 6pm, and not continuously
> poll the input folder.
>
>         <bean id="startPolicy"
> class="org.apache.camel.routepolicy.quartz.CronScheduledRoutePolicy">
>             <property name="routeStartTime" value="0 00 12,18 * * ?"/>
>         </bean>
>
>         <camelContext trace="true"
>                 xmlns="http://camel.apache.org/schema/spring";>
>                 <camel:route id="inputFiles" routePolicyRef="startPolicy"
> autoStartup="false">
> ..........
> </camelContext>
>
> I tried using Quartz but was not successful. If it is possible using Quartz
> and there is any link for Quartz example with spring camel context, then
> please let me know.
>
> Thanks,
> Amruta
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Stop-polling-the-input-folder-after-the-scheduled-route-is-completed-tp5794516.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Reply via email to