You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by Deepak kumar <dk...@gmail.com> on 2016/11/17 05:33:03 UTC
camel multiple scheduler issue
I have two schedulers in my route and i want each schedule to fire at some
particular time of a day and each scheduler is meant for a different task
process.But when i write the below configuration i doesn't execute properly.
I don't understand why both the schedulers are running every second. Please
help
<camel:route id="scheduler1">
<camel:from id="schedule1fr"
uri="scheduler://first?scheduler=quartz2;scheduler.cron=*/10+*+*+*+*+*;"></camel:from>
<camel:setHeader headerName="CamelFileName">
<camel:simple>MyJob-${date:now:yyyyMMdd
HH:mm:ss}.txt</camel:simple>
</camel:setHeader>
<camel:setBody>
<camel:simple>${date:now:yyyyMMdd HH:mm:ss} Hello THis is the
content of text </camel:simple>
</camel:setBody>
<camel:log message="running the
scheduler..................."></camel:log>
</camel:route>
<camel:route id="scheduler2">
<camel:from id="schedule2fr"
uri="scheduler://second?scheduler=quartz2;scheduler.cron=0+0/5+11+*+*+?;"></camel:from>
<camel:setHeader headerName="CamelFileName">
<camel:simple>MyJob-${date:now:yyyyMMdd
HH:mm:ss}.txt</camel:simple>
</camel:setHeader>
<camel:setBody>
<camel:simple>${date:now:yyyyMMdd HH:mm:ss} Hello THis is the
content of text </camel:simple>
</camel:setBody>
<camel:log message="running the
scheduler2..................."></camel:log>
</camel:route>
in the logs :--
2016-11-17 10:58:23.970 INFO 15896 --- [eduler://second] scheduler2
: running the scheduler2...................
2016-11-17 10:58:24.438 INFO 15896 --- [heduler://first] scheduler1
: running the scheduler...................
2016-11-17 10:58:24.486 INFO 15896 --- [eduler://second] scheduler2
: running the scheduler2...................
2016-11-17 10:58:24.954 INFO 15896 --- [heduler://first] scheduler1
: running the scheduler...................
2016-11-17 10:58:25.001 INFO 15896 --- [eduler://second] scheduler2
: running the scheduler2...................
2016-11-
--
View this message in context: http://camel.465427.n5.nabble.com/camel-multiple-scheduler-issue-tp5790200.html
Sent from the Camel Development mailing list archive at Nabble.com.