You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Dennis Holunder <de...@gmail.com> on 2018/11/13 10:08:41 UTC

Quartz resuming outdated trigger after becoming master

Hello,

I have 2 instances of the route which are using zookeeper to make sure
that only one instance is doing the job at 11:15am. Yesterday
instance1 started but not fully completed the job and today after the
restart of instance1, instance2 became the master and resumed the job
from yesterday. Is this expected behavior to resume outdated cron
expressions? I thought it would compute the next run and not use the
previous one.

2018-11-13 09:49:28,248 INFO  o.a.c.c.z.p.MasterRoutePolicy: Elected
as master. Starting consumer:
quartz2://job/all?cron=0+15+11+%3F+*+MON-FRI
2018-11-13 09:49:28,248 INFO  [pool-3-thread-1]
o.a.c.c.q.QuartzEndpoint: Resuming trigger job.all
2018-11-13 09:49:28,250 INFO  [pool-3-thread-1]
o.a.c.c.z.p.MasterRoutePolicy: Elected as master. Consumer started:
quartz2://job/all?cron=0+15+11+%3F+*+MON-FRI
2018-11-13 09:49:28,259 INFO
[DefaultQuartzScheduler-camel-1_Worker-4] leader-selection: Started
route quartz2://job/all?cron=0+15+11+?+*+MON-FRI

Kind regards,
Den

Re: Quartz resuming outdated trigger after becoming master

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Afair quartz has a bunch of options you can use to configure how it
should take action on mis-fired jobs when starting up etc.
Its not trivial to find the right setup, but I suggest to look at the
documentation in both camel quartz and also quartz itself.
On Tue, Nov 13, 2018 at 11:08 AM Dennis Holunder <de...@gmail.com> wrote:
>
> Hello,
>
> I have 2 instances of the route which are using zookeeper to make sure
> that only one instance is doing the job at 11:15am. Yesterday
> instance1 started but not fully completed the job and today after the
> restart of instance1, instance2 became the master and resumed the job
> from yesterday. Is this expected behavior to resume outdated cron
> expressions? I thought it would compute the next run and not use the
> previous one.
>
> 2018-11-13 09:49:28,248 INFO  o.a.c.c.z.p.MasterRoutePolicy: Elected
> as master. Starting consumer:
> quartz2://job/all?cron=0+15+11+%3F+*+MON-FRI
> 2018-11-13 09:49:28,248 INFO  [pool-3-thread-1]
> o.a.c.c.q.QuartzEndpoint: Resuming trigger job.all
> 2018-11-13 09:49:28,250 INFO  [pool-3-thread-1]
> o.a.c.c.z.p.MasterRoutePolicy: Elected as master. Consumer started:
> quartz2://job/all?cron=0+15+11+%3F+*+MON-FRI
> 2018-11-13 09:49:28,259 INFO
> [DefaultQuartzScheduler-camel-1_Worker-4] leader-selection: Started
> route quartz2://job/all?cron=0+15+11+?+*+MON-FRI
>
> Kind regards,
> Den



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