• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

cron vs Quartz

 
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I just started reviewing Quartz, and it seems pretty strong; however, searching through the forum(s) to survey its usage makes me wonder if most applications would be better supported with cron (or a similar app in any given os). Can you help me think through the benefits of quartz?

With quartz you can:
1) time jobs to the second. I'm not sure that this is very important.
2) skip execution on holidays, perhaps this has its uses.
3) use job/trigger/scheduler listeners. Perhaps this is really helpful when employing a transaction framework (with dependencies between jobs).
4) resubmit jobs after jvm crashes/server restarts.

One suspects that you inevitably tie a scheduler to a java service wrapper (if it isn't in some other container)?

However, this seems like a lot of development for a traditional schedule. Are there other benefits that I'm missing? The transaction-support and ability to resubmit a failed job seems attractive (but unnecessary for any of my jobs). I guess that it is ok for me NOT to need quartz, but imagine the horror! What am I missing?
 
Ranch Hand
Posts: 862
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have used and like quartz. Here are some advantages of quartz

1) If you use an OS based cron the jvm would go up and down and any state would be lost.
2) You can schedule multiple threads within quartz
3) We run our scheduler in tomcat and so we can manage and see the state of the app via admin web pages. In our app we use jamon to monitor the state of our processes. It can answer such things as... Which processes are currently running? When did they last run? How long did they take? etc. cron would not allow this.
4) Your code would be more portable. Scheduling is done differently in different OS's.

Probably quartz should be seen more as a replacement for launching new threads than as a replacement of cron.
 
Matt Horton
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the feedback Steve. I think that I can better imagine the sort of project that would be benefited by quartz, but I suspect that in reality the average admin could write a 'typical' job schedule much faster than the average developer (implementing quartz). Of course, I base my opinion on no empirical data ('typical' job category, frequency of implementation, etc.).

I'll write an app in quartz to explore its bells & whistles.

To cron and quartz.
reply
    Bookmark Topic Watch Topic
  • New Topic