You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Mikael Andersson Wigander <mi...@pm.me.INVALID> on 2021/08/10 07:26:58 UTC

Re: Reading a directory on schedule

Hi

Noone with insights on this?

/M

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Friday, July 30th, 2021 at 12:54, Mikael Andersson Wigander <mi...@pm.me> wrote:

> HI, sorry for a stupid question but I can't get this to work properly…
>
> I thought by adding a scheduler to a file component it will only poll for files on schedule but apparently it executes as soon a file is present…
>
> What am I doing wrong here or have I understood this completely wrong?
> http://www.davsclaus.com/2013/08/apache-camel-212-even-easier-cron.html
>
> Camel 2.25.4, Spring Boot 2.2.0.RELEASE
>
> @Component
> public class ReadFilesOnSchedule extends RouteBuilder {
> @Override
> public void configure() throws Exception {
> from(
> "file:test/" +
> "?sortBy=file:modified" +
> "&readLock=fileLock" +
> "&scheduler=quartz2" +
> "&scheduler.cron=0/3+*+*+?+*+MON-FRI" +
> "&scheduler.triggerId=testId" +
> "&scheduler.triggerGroup=TEST")
> .id("TESTSCHEDULER")
> .log("Filename: ${header.CamelFileName}")
> .end();
> }
> }
>
> /M

Sv: Re: Reading a directory on schedule

Posted by Mikael Andersson Wigander <mi...@pm.me.INVALID>.
Hi

  

As a producer to create a file?

I’m trying to consume files in a directory on schedule.

  

  

/M  

  

  

På tis, aug. 10, 2021 vid 10:09, sahyoun@fileaffairs.de
<[sahyoun@fileaffairs.de](mailto:sahyoun@fileaffairs.de)> skrev:

> Hi,  
>  
> havn't used the scheduler option in the file component so I can't  
> provide any input on that.  
>  
> What I have been using though is using the Quartz Component  
> https://camel.apache.org/components/3.4.x/quartz-component.html  
> in combination with file  
>  
> i.e. from quartz to file  
>  
> Might be worth giving that a try.  
>  
> BR  
> Maruan  
>  
>  
>  
>  
>  
> Am Dienstag, dem 10.08.2021 um 07:26 +0000 schrieb Mikael Andersson  
> Wigander:  
> > Hi  
> >  
> > Noone with insights on this?  
> >  
> > /M  
> >  
> > ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐  
> > On Friday, July 30th, 2021 at 12:54, Mikael Andersson Wigander  
> > <mi...@pm.me> wrote:  
> >  
> > > HI, sorry for a stupid question but I can't get this to work  
> > > properly…  
> > >  
> > > I thought by adding a scheduler to a file component it will only poll  
> > > for files on schedule but apparently it executes as soon a file is  
> > > present…  
> > >  
> > > What am I doing wrong here or have I understood this completely  
> > > wrong?  
> > > http://www.davsclaus.com/2013/08/apache-camel-212-even-easier-cron.html  
> > >  
> > > Camel 2.25.4, Spring Boot 2.2.0.RELEASE  
> > >  
> > > @Component  
> > > public class ReadFilesOnSchedule extends RouteBuilder {  
> > > @Override  
> > > public void configure() throws Exception {  
> > > from(  
> > > "file:test/" +  
> > > "?sortBy=file:modified" +  
> > > "&readLock=fileLock" +  
> > > "&scheduler=quartz2" +  
> > > "&scheduler.cron=0/3+*+*+?+*+MON-FRI" +  
> > > "&scheduler.triggerId=testId" +  
> > > "&scheduler.triggerGroup=TEST")  
> > > .id("TESTSCHEDULER")  
> > > .log("Filename: ${header.CamelFileName}")  
> > > .end();  
> > > }  
> > > }  
> > >  
> > > /M  
>  
> \--  
> \--  
> Maruan Sahyoun  
>  
> FileAffairs GmbH  
> Josef-Schappe-Straße 21  
> 40882 Ratingen  
>  
> Tel: +49 (2102) 89497 88  
> Fax: +49 (2102) 89497 91  
> sahyoun@fileaffairs.de  
> www.fileaffairs.de  
>  
> Geschäftsführer: Maruan Sahyoun  
> Handelsregister: AG Düsseldorf, HRB 53837  
> UST.-ID: DE248275827  
>  
>

  

  


Re: Reading a directory on schedule

Posted by "sahyoun@fileaffairs.de" <sa...@fileaffairs.de>.
Hi,

havn't used the scheduler option in the file component so I can't
provide any input on that.

What I have been using though is using the Quartz Component
https://camel.apache.org/components/3.4.x/quartz-component.html
in combination with file 

i.e. from quartz to file

Might be worth giving that a try.

BR
Maruan 





Am Dienstag, dem 10.08.2021 um 07:26 +0000 schrieb Mikael Andersson
Wigander:
> Hi
> 
> Noone with insights on this?
> 
> /M
> 
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> On Friday, July 30th, 2021 at 12:54, Mikael Andersson Wigander
> <mi...@pm.me> wrote:
> 
> > HI, sorry for a stupid question but I can't get this to work
> > properly…
> > 
> > I thought by adding a scheduler to a file component it will only poll
> > for files on schedule but apparently it executes as soon a file is
> > present…
> > 
> > What am I doing wrong here or have I understood this completely
> > wrong?
> > http://www.davsclaus.com/2013/08/apache-camel-212-even-easier-cron.html
> > 
> > Camel 2.25.4, Spring Boot 2.2.0.RELEASE
> > 
> > @Component
> > public class ReadFilesOnSchedule extends RouteBuilder {
> > @Override
> > public void configure() throws Exception {
> > from(
> > "file:test/" +
> > "?sortBy=file:modified" +
> > "&readLock=fileLock" +
> > "&scheduler=quartz2" +
> > "&scheduler.cron=0/3+*+*+?+*+MON-FRI" +
> > "&scheduler.triggerId=testId" +
> > "&scheduler.triggerGroup=TEST")
> > .id("TESTSCHEDULER")
> > .log("Filename: ${header.CamelFileName}")
> > .end();
> > }
> > }
> > 
> > /M

-- 
-- 
Maruan Sahyoun

FileAffairs GmbH
Josef-Schappe-Straße 21
40882 Ratingen

Tel: +49 (2102) 89497 88
Fax: +49 (2102) 89497 91
sahyoun@fileaffairs.de
www.fileaffairs.de

Geschäftsführer: Maruan Sahyoun
Handelsregister: AG Düsseldorf, HRB 53837
UST.-ID: DE248275827