You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Larry Meadors <la...@gmail.com> on 2013/03/04 21:21:12 UTC

Quartz component question

I have a weekly data export that uses a quart timer defined like this:

quartz://circVendorRoyaltyTimer?cron=0+0+1+?+*+SAT+*

The timer sends a message to a route that in turn sends a message with
a date range in it to another route that queries the data based on
that date range and then puts the results in a queue.

This was done so that the default behavior would be a timed export,
but we can manually export different date ranges and suspend the timer
route for testing while leaving the manual export enabled.

Early last Friday, I deployed a new version of this and then used JMX
to suspend the timer.

I then sent the message to trigger a manual export at 1:13am on Saturday.

The export processing is done by a system on the other side of the
country, so it wasn't until this morning that I found out that there
were two exports done:
 - one at 1:00am
 - one at 1:13am

I double checked the timer this morning, it's stopped.

I think my question is: Does the quartz component schedule the job
proactively when it starts, or is it somehow waiting for the time to
arrive, then running it at that time?

Based on the outcome of my export, I'm guessing the former. If that's
true, is there a way to cancel that scheduled job?

Larry

Re: Quartz component question

Posted by Claus Ibsen <cl...@gmail.com>.
On Mon, Mar 4, 2013 at 9:21 PM, Larry Meadors <la...@gmail.com> wrote:
> I have a weekly data export that uses a quart timer defined like this:
>
> quartz://circVendorRoyaltyTimer?cron=0+0+1+?+*+SAT+*
>
> The timer sends a message to a route that in turn sends a message with
> a date range in it to another route that queries the data based on
> that date range and then puts the results in a queue.
>
> This was done so that the default behavior would be a timed export,
> but we can manually export different date ranges and suspend the timer
> route for testing while leaving the manual export enabled.
>
> Early last Friday, I deployed a new version of this and then used JMX
> to suspend the timer.
>
> I then sent the message to trigger a manual export at 1:13am on Saturday.
>
> The export processing is done by a system on the other side of the
> country, so it wasn't until this morning that I found out that there
> were two exports done:
>  - one at 1:00am
>  - one at 1:13am
>
> I double checked the timer this morning, it's stopped.
>
> I think my question is: Does the quartz component schedule the job
> proactively when it starts, or is it somehow waiting for the time to
> arrive, then running it at that time?
>

Yeah I think it waits for the time to arrive. It starts the quartz
scheduler and it then figures out when to trigger/fire jobs.
Though this can become complex if you want to deal with mis-fire rules
and whatnot. Though that is in the Quartz API,
and we do not leverage that in the camel-quartz consumer component.



> Based on the outcome of my export, I'm guessing the former. If that's
> true, is there a way to cancel that scheduled job?
>

The Quartz Scheduler should have API to control the jobs. And you may
access the API on QuartzComponent / Endpoint as well where we may have
exposes some APIs as well.

I guess it would be good if we have some JMX API as well. And some way
to list current jobs that are scheduled, so you can get an overview.
And control these.

As usual contributions and patches is much welcome.

> Larry



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen