camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chandra Kalirasa" <ckalir...@seatoncorp.com>
Subject RE: Quartz Scheduling to move files
Date Tue, 18 Sep 2012 22:17:18 GMT
Hi Claus,
I went through documents, could not get much info.

This is my scenario:
I am trying to schedule a job that trigger FTP server to move the  files another directory.

  context.addRoutes(new RouteBuilder() {
            public void configure() {
           	from("quartz://myFirstTimer?cron=0+55+16+*+*+?")
                 .to("ftp://172.17.0.150/datatransfer/TEST?username=chandra&password=passwd")
            	.to("file://outputdir");
            }
        });

        // start the route and let it do its work
        context.start();
        Thread.sleep(10000);

I noticed that quartz is scheduling when the time is up, but files are not moving and getting
the following errors.  Please, let me know if there is any example using quartz with routing
the files.

[                          main] StdSchedulerFactory            INFO  Quartz scheduler 'DefaultQuartzScheduler-camel-1'
initialized from an externally provided properties instance.
[                          main] StdSchedulerFactory            INFO  Quartz scheduler version:
1.8.5
[                          main] DefaultCamelContext            INFO  Route: route1 started
and consuming from: Endpoint[quartz://myFirstTimer?cron=0+55+16+*+*+%3F]
[                          main] QuartzComponent                INFO  Starting Quartz scheduler:
DefaultQuartzScheduler-camel-1
[                          main] QuartzScheduler                INFO  Scheduler DefaultQuartzScheduler-camel-1_$_NON_CLUSTERED
started.
[                          main] DefaultCamelContext            INFO  Total 1 routes, of which
1 is started.
[                          main] DefaultCamelContext            INFO  Apache Camel 2.10.0
(CamelContext: camel-1) started in 0.752 seconds
[artzScheduler-camel-1_Worker-1] RemoteFileProducer             INFO  Connected and logged
in to: Endpoint[ftp://172.17.0.150/datatransfer/ /TEST/backup?password=******&username=chandra]
[artzScheduler-camel-1_Worker-1] RemoteFileProducer             WARN  Writing file failed
with: Cannot store file: datatransfer/Delta-HR/ps-drop/TEST/backup/ID-EVG60LT-3-CKALI-58842-1348005273855-0-1
[artzScheduler-camel-1_Worker-1] DefaultErrorHandler            ERROR Failed delivery for
(MessageId: ID-EVG60LT-3-CKALI-58842-1348005273855-0-1 on ExchangeId: ID-EVG60LT-3-CKALI-58842-1348005273855-0-2).
Exhausted after delivery attempt: 1 caught: org.apache.camel.component.file.GenericFileOperationFailedException:
Cannot store file: datatransfer/TEST /ID-EVG60LT-3-CKALI-58842-1348005273855-0-1
org.apache.camel.component.file.GenericFileOperationFailedException: Cannot store file: datatransfer/TEST/ID-EVG60LT-3-CKALI-58842-1348005273855-0-1
	at org.apache.camel.component.file.remote.FtpOperations.doStoreFile(FtpOperations.java:513)[camel-ftp-2.10.0.jar:2.10.0]
	at org.apache.camel.component.file.remote.FtpOperations.storeFile(FtpOperations.java:474)[camel-ftp-2.10.0.jar:2.10.0]
	at org.apache.camel.component.file.GenericFileProducer.writeFile(GenericFileProducer.java:249)[camel-core-2.10.0.jar:2.10.0]
	






-----Original Message-----
From: Claus Ibsen [mailto:claus.ibsen@gmail.com] 
Sent: Tuesday, September 18, 2012 10:39 AM
To: users@camel.apache.org
Subject: Re: Quartz Scheduling to move files

Hi

See route policy
http://camel.apache.org/routepolicy

This can be used to schedule routes when they shall be active.
You can then use this for a route that moves files.


On Tue, Sep 18, 2012 at 5:33 PM, Chandra Kalirasa
<ckalirasa@seatoncorp.com> wrote:
> Hi:
>
> I am using Quartz to schedule a job that runs every 20 seconds to move the files from
inputdir to outputdir.  I am getting errors.  Please advise.
>
> Thank you,
>
> chandra
>
>
>
> Route:
>
>         CamelContext context = new DefaultCamelContext();
>
>
>
>             context.addRoutes(new RouteBuilder() {
>
>             public void configure() {
>
>                    from("quartz://myTimer?period=2000").to("file://inputdir")
>
>                    .to("file://output");
>
>             }
>
>         });
>
>   context.start();
>
>         Thread.sleep(10000);
>
>         context.stop();
>
>
>
>
>
> Using job-store 'org.quartz.simpl.RAMJobStore' - which does not support persistence.
and is not clustered.
>
>
>
> [                          main] StdSchedulerFactory            INFO  Quartz scheduler
'DefaultQuartzScheduler-camel-1' initialized from an externally provided properties instance.
>
> [                          main] StdSchedulerFactory            INFO  Quartz scheduler
version: 1.8.5
>
> [                          main] DefaultCamelContext            INFO  Route: route1 started
and consuming from: Endpoint[quartz://myTimer?trigger.repeatCount=-1&trigger.repeatInterval=2000]
>
> [                          main] QuartzComponent                INFO  Starting Quartz
scheduler: DefaultQuartzScheduler-camel-1
>
> [                          main] QuartzScheduler                INFO  Scheduler DefaultQuartzScheduler-camel-1_$_NON_CLUSTERED
started.
>
> [                          main] DefaultCamelContext            INFO  Total 1 routes,
of which 1 is started.
>
> [                          main] DefaultCamelContext            INFO  Apache Camel 2.10.0
(CamelContext: camel-1) started in 0.625 seconds
>
> [artzScheduler-camel-1_Worker-1] DefaultErrorHandler            ERROR Failed delivery
for (MessageId: ID-EVG60LT-3-CKALI-52599-1347981629198-0-1 on ExchangeId: ID-EVG60LT-3-CKALI-52599-1347981629198-0-2).
Exhausted after delivery attempt: 1 caught: org.apache.camel.component.file.GenericFileOperationFailedException:
Cannot store file: inputdir\ID-EVG60LT-3-CKALI-52599-1347981629198-0-1
>
> org.apache.camel.component.file.GenericFileOperationFailedException: Cannot store file:
inputdir\ID-EVG60LT-3-CKALI-52599-1347981629198-0-1
>
>       at org.apache.camel.component.file.FileOperations.storeFile(FileOperations.java:246)[camel-core-2.10.0.jar:2.10.0]
>
>       at org.apache.camel.component.file.GenericFileProducer.writeFile(GenericFileProducer.java:249)[camel-core-2.10.0.jar:2.10.0]
>
>       at org.apache.camel.component.file.GenericFileProducer.processExchange(GenericFileProducer.java:151)[camel-core-2.10.0.jar:2.10.0]
>
>       at org.apache.camel.component.file.GenericFileProducer.process(GenericFileProducer.java:76)[camel-core-2.10.0.jar:2.10.0]
>
>       at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)[camel-core-2.10.0.jar:2.10.0]
>
>       at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.0.jar:2.10.0]
>
>       at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:120)[camel-core-2.10.0.jar:2.10.0]
>
>       at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:292)[camel-core-2.10.0.jar:2.10.0]
>
>       at o
>
>
>
>
>
>
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen




Mime
View raw message