Hi

You can try set .noAutoStartup() on that route as its controlled by
the scheduler

On Fri, Jul 30, 2021 at 12:54 PM Mikael Andersson Wigander
<mikael.andersson.wigan...@pm.me.invalid> 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



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Reply via email to