If I should call you up, invest a dime
And you say you belong to me and ease my mind
Imagine how the world could be, so very fine
So happy together
-G. Bonner & A. Gordon, “Happy Together”
What’s Missing from Quartz
If you need scheduled tasks on the JVM, Quartz by Terracotta is the standard solution. It has one responsibility that it does well: reliably executing jobs on a defined schedule. Unfortunately, every time you use Quartz, you have to write your own:
Monitoring & stat tracking
If you have run Quartz for a while you have probably realized you need a more robust administration of the cluster. Taking a phone call at 10 pm so you can make changes to a schedule? Sending someone MySQL credentials so they can view the list of schedule jobs? It’s neither fun nor sustainable. Viewing jobs, histories, and scheduled triggers requires a friendlier interface.
Patching it with Piezo
I decided to solve these problems with Piezo, an complete open source job processing solution for Quartz. It provides all of the boilerplate code, plus a bunch of cool admin tools for your Quartz job scheduler.
Use the 5 setup steps on github to be up and running with a Piezo job system in 5 minutes!
Piezo comes with two main components:
1) Piezo Worker – a Java main() driver for a Quartz scheduler, and
2) Piezo Admin – an easy web interface for viewing, adding, editing, and deleting jobs.
The components can be used independently or together to complete your job scheduling solution.
The Piezo Worker gives you an easy way to run a job scheduler. It’s a Java main() class that lets you easily run a Quartz scheduler instance. It includes a convenient shutdown hook on the SIGINT signal (ctrl-c).
It even provides a default startup script for you to use:
One of the major features missing from the Quartz scheduler, even when using a persistent job store, is its lack of historical data about jobs. Piezo extends the standard set of tables in the JDBCJobStore and tracks the start time, stop time, and exit status of every job run by every trigger.
See a list of jobs organized by group, details for a job, and a history of when the job was run. The user can also add, edit, and remove jobs from the data store.
Triggers can be similarly listed, viewed, and modified.