Problems that we faced with this setup:
- No GUI to see what job is currently executing, when is the next run of this job scheduled.
- Say I want to see the logs for the job foo that ran yesterday at 8:30 in the night, quartz did not provide this out of the box.
- How do I monitor whether the jobs are running fine?
- No way to cancel a currently running job.
- Say I want to fire a job right now but it’s scheduled run is 15 minutes later, how do I do this?
- If there is an error while running a job, how do I get to know of this?
- Say for sometime I do not want a job to run, how do I achieve this?
- If a job is stuck for sometime, how do I time it out and re run it?
Most of you might know jenkins as a build/continuous integration server, but it solves all of the problems listed above.
We used to run our quartz jobs through spring quartz integration. As the first step, we removed this and created a main method for each job. Each of these main methods were configured as new jobs in jenkins. We rigged up our jenkins in such a way that as soon as the build is done, these jobs are triggered. Once triggered, these jobs call themselves at a pre determined interval.
With this configuration, we get a lot of things out of the box:
- Nice GUI to monitor and see which jobs are currently running, which jobs are scheduled to run later, health of each run.
- Through the GUI, we can run a job out of line, suspend a job for sometime and re enable it or completely nuke a job.
- We can configure a job to time out if stuck and re trigger.
- We get a complete history(configurable) of each job’s run along with the status of that run as well as the logs for that run.
If you too are interested in doing geeky things like this, let us know at firstname.lastname@example.org. We are always looking for curious people who want to build beautiful products.