This post originated from an RSS feed registered with Java Buzz
by Simon Brown.
Original Post: Scheduling in Java : Flux and Quartz
Feed Title: Simon Brown's weblog
Feed URL: http://www.simongbrown.com/blog/feed.xml?flavor=rss20&category=java
Feed Description: My thoughts on Java, software development and technology.
I've spent the past few days looking at some of the scheduling solutions for Java-based applications, and specifically at Flux and Quartz. Both are scheduling tools written in Java and both can be embedded in J2SE and J2EE applications.
Feature wise, they provide the ability to schedule recurring jobs, one off jobs and, with Flux, complete flowcharts containing complex combinations of jobs. With both tools, starting the scheduler is a fairly trivial task (a couple of lines of code) and creating jobs is just a matter of implementing a specific interace, which makes wrapping up existing functionality really easy. Also, both support clustering and failover by persisting job information/state in a database that's shared between all scheduling nodes.
Flux is a commercial product while Quartz is open source, and if you've not looked at the two of them it can be tricky to decide which will fulfil your needs. I really like Quartz. It's easy to use, lightweight and there are a whole bunch of additional features (such as integration with JTA) that make it a great tool. If you're looking for an open source solution for scheduling work in your application, it's definitely worth a look.
So, with Flux being a commercial product, what do you get for your cash? I'm currently evaluating Flux at the moment and haven't looked at all of the features (there are a lot of them), but for the project I'm working on, there are some features that will probably be really useful. For example, Flux has the ability define job priorities so that you can influence the order in which jobs are executed and it also has a feature called concurrency throttling so that you can limit the number of jobs (and specific types of jobs) that are executed simultaneously. The other nice feature is that you get a JMX MBean included in the distribution that allows you to manage your scheduler instances through standard tooling.
Very few of my previous projects have used scheduling and having looked at a couple of scheduling tools, it's interesting to see what's available and how they've been improved over the years. Quartz 2.0 has some interesting design goals and it will be good to keep an eye on this in the future. The evaluation continues.