You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by lleclerc <ll...@aim-rg.com> on 2013/04/11 00:27:42 UTC

How to use quartz to schedule a file transfer ?

Hi,

How to use quartz to schedule a file transfer ?
from(quartzUri).to(fileUri1).to(fileUri2); doesn't seems to work.

Thanks,



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-use-quartz-to-schedule-a-file-transfer-tp5730696.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to use quartz to schedule a file transfer ?

Posted by lleclerc <ll...@aim-rg.com>.
Thanks ! Exactly what I was searching for !

What is different between the previous route I wrote and this : 
from(timerUri).to(http4Uri).process(...)   <-- This one does the job



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-use-quartz-to-schedule-a-file-transfer-tp5730696p5730716.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to use quartz to schedule a file transfer ?

Posted by Chris Wolf <cw...@gmail.com>.
You don't directly use the Quartz Component - you use a RoutePolicy, of
which two concrete implementations will setup
the Quartz Component and register it in the context for you.

Here's an example from:
http://camel.apache.org/simplescheduledroutepolicy.html

...which I changed a little to match your question.

See also:

http://camel.apache.org/routepolicy.html
http://camel.apache.org/scheduledroutepolicy.html
http://camel.apache.org/simplescheduledroutepolicy.html
http://camel.apache.org/cronscheduledroutepolicy.html

SimpleScheduledRoutePolicy policy = new
SimpleScheduledRoutePolicy();long startTime =
System.currentTimeMillis() + 3000L;
policy.setRouteStartDate(new Date(startTime));
policy.setRouteStartRepeatCount(1);
policy.setRouteStartRepeatInterval(3000);

from("file:/tmp/inputdir").routeId("file.test")
   .routePolicy(policy).noAutoStartup()
   .to("file:/tmp/destdir");


   -Chris



On Wed, Apr 10, 2013 at 6:27 PM, lleclerc <ll...@aim-rg.com> wrote:

> Hi,
>
> How to use quartz to schedule a file transfer ?
> from(quartzUri).to(fileUri1).to(fileUri2); doesn't seems to work.
>
> Thanks,
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/How-to-use-quartz-to-schedule-a-file-transfer-tp5730696.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>