camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmh <jeanmarc.her...@nrb.be>
Subject camel-ftp and crontab
Date Thu, 25 Nov 2010 22:15:58 GMT

Hello, 

I need to start a camel-ftp component periodicaly with a cron expression
(every friday at 10pm)

The problem is that camel-ftp does not have this option out-of-the-box (only
a delay)

So I have imagined this solution that seems to work fine !

What do camel-gurus think about ?

		from("quartz://dmm?cron=" + cron).routeId("quartz").process(
				new Processor() {
					public void process(Exchange ex) throws Exception {
						ex.getContext().startRoute("ftp");
					}
				});

		from(
				"ftp://" + username + "@" + server + "/out?password="
						+ password + options)
				.routeId("ftp")
				.noAutoStartup()				
				.to("file://"
						+ outDir
						+ "?fileName=domymove.txt&tempFileName=${file:onlyname.noext}.tmp")
				.process(new Processor() {
					public void process(Exchange ex) throws Exception {
						ex.getContext().stopRoute("ftp");
					}
				});

Regards
J-M
-- 
View this message in context: http://camel.465427.n5.nabble.com/camel-ftp-and-crontab-tp3280663p3280663.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message