I've been a software developer for over 15 years, working in Java since 1998. Have worked in ecommerce, finance and governmental regulatory bodies for the past 9 years as developer, architect and development manager. Currently doing contact development on the Android platform, Java web projects using the latest frameworks such as Backbone and Marionnette using Cloud platforms including AWS and DynamoDB. Craig is a DZone MVB and is not an employee of DZone and has posted 14 posts at DZone. You can read more from them at their website. View Full User Profile

Why you shouldn't use Quartz Scheduler

01.30.2012
| 79673 views |
  • submit to reddit

If you need to schedule jobs in Java, it is fairly common in the industry to use Quartz directly or via Spring integration. Quartz’ home page at the time of writing claims that using quartz is a simple 3-step process: Download, add to app, execute jobs when you need to. For any of you that actually have experience with Quartz, this is truly laughable.

First of all, adding the quartz library to your app does not begin to ready your application to schedule jobs. Getting your code to run in a schedule with quartz is anything but straightforward. You have to write your implementation of the job interface, then you have to construct large xml configuration files or add code to your application to build new instances of JobDetails, Triggers using complex api such as
 .withIdentity("myTrigger", "group1").startNow().withSchedule(simpleSchedule()
.withIntervalInSeconds(40).repeatForever()).build()
and then schedule them using Schedule instance from a ScheduleFactory. All this is code you have to write for each job or the equivalent xml configuration. Quite the headache for something that was supposed to simply be “execute jobs when you need to”. Even in Quartz’ tutorial, it takes 6 lessons to setup a job. What happens when you need to make a change to a job’s schedule? Temporarily disable a job? Change the parameters bound to a job? All these require a build/test/deploy cycle which is impractical for any organization.

Quartz is also deficient in its feature set. Out of the box, it is just a code library for job execution. No monitoring console for reviewing errors and history, no useful and reasonably searchable logging, no support for multiple execution nodes, no adminstration interface, no alerts or notifications, inflexible and buggy recovery mechansims for failed jobs and missed jobs.

Quartz does provide add-on support for multiple nodes, but it requires additional advanced configuration. Quartz also provides an add-on called Quartz Manager, it too needs additional advanced configuration, is a flash app and is incrediby cumbersome and impractical to use.

Simply put, Quartz doesn’t meet these basic needs:

  • No out of the box support for multiple execution nodes (pooling or clustering)
  • No adminstration UI that allows all job scheduling and configuration to be done outside of code
  • No monitoring
  • No alerts
  • Insufficient mechanisms for dealing with errors/failures and recovery

All this means Quartz is not really a justifiable choice as an enterprise scheduler. It is feature poor and has high implementation and ongoing utilization costs in terms of time and energy.

Obsidian Scheduler really is the best choice for your java-based applications. You truly can be up and running the same day you download it. We have a live, interactive demo where you can try out the interface and see first-hand how easy it is to add/change/disable jobs, to monitor all the node activity, disable/enable nodes and even take advantage of advanced schedule configuration such as chaining and sticky nodes.

In addition to our product website, we’ve discussed Obsidian’s standout features many times here on our blog. Download it today and give it a try!

 

From http://www.carfey.com/blog/why-you-shouldnt-use-quartz-scheduler/

Published at DZone with permission of Craig Flichel, author and DZone MVB.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Tags:

Comments

sd giant replied on Mon, 2012/01/30 - 12:54am

Seems like a nice product, but I think full disclosure would be to mention the $999 licence fee for the product...

Mason Mann replied on Mon, 2012/01/30 - 2:42am

Obsidian. $999.99. 

HAHAHAHAHAHHAHAHAHAHAHAH.

Just install free cron4j and be happy (literally up and running in 5 minutes).

Christoph Kutzinski replied on Mon, 2012/01/30 - 3:59am

Erm, okay. There are probably really some features missing or not so intuitive in Quartz. But that this is written by someone employed at the company producting the other product, gives the whole article a kind of smell ...

Mihai Dinca - P... replied on Mon, 2012/01/30 - 4:16am

I agree with :

 - quartz is not just "Download, add to app, execute jobs when you need to"

 - it's not just "out-of-the -box"

But , if you need pooling it's easier to do with a Spring ThreadPollTaskExecutor:

<bean id="schedulingTaskExecutor" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
        <property name="threadNamePrefix" value="Scheduler-"/>
        <property name="corePoolSize" value="#{settings.getSchedulerCorePoolSize()}"/>
        <property name="maxPoolSize" value="#{settings.getSchedulerMaxPoolSize()}"/>
        <property name="queueCapacity" value="#{settings.getSchedulerQueueCapacity()}"/>
</bean>

and use a SchedulerFactoryBean:

 <bean id="scheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
        <property name="autoStartup" value="true"/>
        <property name="waitForJobsToCompleteOnShutdown" value="true"/>
        <property name="taskExecutor">
            <ref local="schedulingTaskExecutor"/>
        </property>
        <property name="quartzProperties">
            <props>
                <prop key="org.quartz.scheduler.instanceName">Scheduler</prop>
                <prop key="org.quartz.scheduler.instanceId">AUTO</prop>
                <prop key="org.quartz.plugin.shutdownhook.class">org.quartz.plugins.management.ShutdownHookPlugin</prop>
                <prop key="org.quartz.plugin.shutdownhook.cleanShutdown">true</prop>
                <prop key="org.quartz.plugin.triggHistory.class">org.quartz.plugins.history.LoggingTriggerHistoryPlugin</prop>
                <prop key="org.quartz.plugin.triggHistory.triggerFiredMessage">Trigger {1}.{0} fired job {6}.{5} at {4, date, HH:mm:ss dd/MM/yyyy}</prop>
                <prop key="org.quartz.plugin.triggHistory.triggerCompleteMessage">Trigger {1}.{0} completed firing job {6}.{5} at {4, date, HH:mm:ss dd/MM/yyyy} with resulting trigger instruction code {9}</prop>
            </props>
        </property>
        <property name="triggers">
            <list>
                ....

           </list>
        </property>
</bean>

This scheduler must be use in your handler:

 <bean id="myJobHandler" class="com.mypackage.MyJobHandler">
        <property name="scheduler">
            <ref local="scheduler"/>
        </property>

</bean>

Regarding "No adminstration UI"and "no monitor" I guess you have to do it yourself. It may not be a very easy task, but it surely is not complicated and it depends of your business. I can give you an example from NextReports where Quartz scheduler is used. See the demo when you select a report and schedule it. There is a user-friendly interface to add jobs, not just cron strings. And also our monitor , which fits our needs, allows to see running , active and finished jobs.

So I disagree with "best choice", I see your software as an  "alternative choice" .

 

Ender Orak replied on Thu, 2012/02/02 - 10:53am

I totally agree with your opinions. I had to use Quartz one of our projects and I had to inspect its code because of some unexpected behaviours, and I can honestly say that it has one of the worst code bases I have ever seen. Not simple to use, not written & documented well, heavyweight and unpleasant project. Edit: I agree with the Quartz part, not commercial side.

Kevin M Diffily replied on Mon, 2012/01/30 - 8:58am in response to: Christoph Kutzinski

Yes this article is definately spam.

David Lee replied on Mon, 2012/01/30 - 11:31am

Worst Post Ever.

Matt Young replied on Mon, 2012/01/30 - 11:59am

HAHAHAH The website is completely down right now. I see what happened here
1) bash quartz
2) stand up website on geocities
3) profit

LMAO
Maybe next time you should plan for a little traffic if you are gonna try and do viral marketing.

André Pankraz replied on Mon, 2012/01/30 - 2:47pm

calm down...he really has some points, commercial stuff or not. at least you could propose alternatives if you think he is wrong, e.g. for web ui, job monitoring etc.

Steven Goldsmith replied on Mon, 2012/01/30 - 5:17pm

cron4j rules!

Scheduler s = new Scheduler();
s.schedule("* * * * *", new Runnable() {
    public void run() {
        System.out.println("Another minute ticked away...");
    }
});
s.start();

Developer Dude replied on Mon, 2012/01/30 - 5:44pm

More or less valid criticisms (it's been a while since I last worked with Quartz, but I do remember some of it was clunky and awkward and could definitely use some major refactoring). IIRC, Spring took on Quartz but last I checked they just put a layer on top of it and didn't do much to the Quartz API itself - but Spring does have a batch processor that has a lot more features than Quartz, including retry/etc., which Quartz lacks (or did lack last I looked).

To be fair to Quartz, it is meant to be a low level scheduling API, not a full on "enterprise scheduling" product, and it is free, so comparing it to something that costs $1K and is a commercial product meant to be something a lot more comprehensive is comparing apples and oranges.

Moreover, for purposes of fairness and disclosure, it would be best for the author to state their involvement in the product they are promoting.

Michal Steiner replied on Tue, 2012/01/31 - 11:36am

This post should be marked as commercial ...

Manish Chowdhary replied on Mon, 2012/04/02 - 7:42pm

I don't know if I would call it commercial, I would just call it a review - GoECart Staff

Matt Watson replied on Tue, 2013/02/12 - 11:38am

I am in the process of playing with Quartz at Stackify  and I agree it's API is kind of funky. But it seems to work fine. I am using it for a job scheduler across multiple servers. The clustering is working just fine. Was able to create a listener to log when jobs run. But it has been more difficult than it should be to figure out the API. The tutorials on the Quartz.net  website aren't even accurate.

David Diller replied on Sat, 2013/02/16 - 10:47am

 We've used Quartz for years, I agree the API could be more intuitive but Quartz works. I'm ramping up a new Project and I'll use Quartz again.

Rauf Issa replied on Fri, 2013/03/08 - 3:43pm

JobServer  is fully featured job scheduler. Has all the scheduling features with monitor, reporting, audit trail, permission, and tracking with robust UI....etc. Has open source SDK called sofaces that allows building custom java Tasklets for backend processing and you can give each Tasklet an optional web customization using GWT.

There is free version of JobServer that runs on HSQL for single node, but is fully featured. More advanced configurations require paid version.

Jan Moravec replied on Wed, 2013/06/05 - 8:01pm

Hello,

If you are missing a decent GUI manager for the Quartz scheduler that supports all common job/trigger operations, job execution history (including job execution log capture!), statistics, notifications (email, all popular IM protocols,...) and monitoring then please check out our website www.quartzdesk.com.

We are just in the process of finishing up the website and a couple of links do not work yet. Sorry about that. All should be ready in a week or two.

We are offering free trial licenses and a completely free QuartzDesk Lite license. If you like us on FaceBook , you get a nice early adopter discount on all purchases.

Best regards,
Jan Moravec
QuartzDesk Founder


Rauf Issa replied on Sat, 2013/07/13 - 10:40am

JobServer is a distributed job scheduler with full blown scheduling/processing/management web UI. The UI is pretty comprehensive for managing jobs and environment. It also has an open source java developer SDK for developing custom Tasklets. You can find it here http://grandlogic.com 

Craig Flichel replied on Thu, 2013/09/05 - 2:10pm in response to: Mason Mann

Obsidian is free to use on a single node forever and only $250 for additional nodes in a cluster. We provide a free second node for one full year to allow for evaluation of our clustering support. All Obsidian users, paying or not, are entitled to our free support offered through live chat, email or by telephone.

Stuart Stephen replied on Thu, 2013/09/12 - 8:11am

This article has a heavily biased slant. Take it with a pinch of salt.

Abhishek Choudhary replied on Thu, 2013/09/26 - 1:07pm

I am not not accepting all the points mentioned.I am using Quartz even in Cloud environment and it never let me down.Is it because of excellent cloud service or Quartz is so stable , I am not sure.I tried Jelastic for Quartz JoB Scheduling-http://jelastic.com/docs/quartzAnd found it work super well.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.