Monitor state of a job Waiting/ Executing OR Completed.

2,920 views
Skip to first unread message

Sufian

unread,
Jul 11, 2011, 1:47:04 PM7/11/11
to Quartz.NET
Folks,
I create a job and associate a SimpleTrigger with the job to fire once
immidiately. I want the ability to monitor if my job is currently in
the waiting state (waiting for a Quartz scheduler to execute it) or
executing state or has completed its execution.

The behavior I am currently seeing with Quartz 1.0.3 doesn't allow me
to do that. I am running Quartz in a Clustered environment while using
the AdoJobStore. The behavior I see is as follows:

- if the trigger succeeds, the trigger + the job (JobDetails) get
deleted
- if the trigger fails, the trigger + the job are not get deleted and
the trigger is marked as "COMPLETE".
- even before a trigger actually starts execution, Quartz marks the
trigger's state as COMPLETE. This means that if a job is marked as
COMPLETE, may be the job is still being exuected OR the job actually
completed and failed.

Please tell me if the behavior I am seeing is expected? And if so, how
can I achieve my original goal to monitor if my job is waiting or
executing or has completed.

Thanks,
Sufian.

Jay Vilalta

unread,
Jul 11, 2011, 4:50:22 PM7/11/11
to quar...@googlegroups.com
I've implemented a reporting system using quartz.net where users need to know if their report is pending, running or completed. This seems similar to what you are doing. This was done using an additional table to keep track of this information. When the job is queued, you write a record into the database and mark it as pending. When the job executes, you mark that record as running and when the job finishes, you mark it as completed (or failed if there's an error). 

You can do this using listeners and/or code the logic in your application and job. 

Other than this you can get a list of running robs from each scheduler, so I suppose you could also use that plus the information you mention below to come up with a status, but the solution we went with seemed to work pretty well,


--
You received this message because you are subscribed to the Google Groups "Quartz.NET" group.
To post to this group, send email to quar...@googlegroups.com.
To unsubscribe from this group, send email to quartznet+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/quartznet?hl=en.


Reply all
Reply to author
Forward
0 new messages