Hi all -
Wow it has been a long time since I have posted on here and thought I would get back into blogging as I miss doing it and sharing my knowledge with the world about my love for computing..
I have been super busy these past few months working at the startup of Indigo with our clients and growing its business as well as growing the Software Development Community.
I am super excited to share with you a technology called Quartz. We are currently using Quartz at work to solve some of our complex data problems we face.
1) What is Quartz?
So Quartz is simply put a job scheduler framework. Just like UNIX cron jobs it can execute simple jobs or complex jobs at recurring set time interval. Quartz was originally written in Java by its founder James House.
2) Why can’t I just use Windows task scheduler?
Well windows task scheduler works well but what if the server crashes, or you want the scheduler integrated in your services that do specific work in your application…you can’t integrate this. Plus how do you handle Windows task scheduler across multiple clusters — forget it you need something more powerful as your application grows ins size as Quartz can support a clustered environment.
3) How is Quartz licensed?
Well Quartz is open source…you can download and look at the source code to learn how to use it. I actually was able to find great examples in the unit tests of the original source code.
4) Is Quartz being actively developed?
Yes it is. It is supported by an active development.
5) Can I use Quartz in embedded?
The size of the Quartz.dll is actually quite small and could be used in small-scale embedded applications.
So what does a basic Job look like.
In Quartz all jobs implement the IJob interface. In here you would define the specific work that needs to be done in the job.
After you have implemented your job, you need to attach it to a JobDetail.
Once attached to a job detail, you can attach a Trigger.
The Trigger is important as it defines the type of recurrence you can schedule. A SimpleTrigger allows the job to occur every so many N nanoseconds where a CronTrigger allows it to occur every “night at midnight for three consecutive weeks in a month” type requirement.
Once your trigger is defined you simply add this to the Quartz scheduler and it will run the job when you start the Quartz scheduler.
How cool is that … now you run that job that makes a 1000 record insert quickly in the background.
More to come on Quartz so stay tuned.