camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amruta Jawlekar <amrut...@ignitiv.com>
Subject Stop polling the input folder after the scheduled route is completed
Date Mon, 27 Feb 2017 12:51:36 GMT
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.

Mime
View raw message