I already asked a separate question on how to create time triggered event in Java. I was introduced to Quartz.
At the same time, I also google it online, and people are saying cron
in Unix is a neat solution.
Which one is better? What's the cons and pros?
Some specification of the system: * Unix OS * program written in Java * I have a task queue with 1000+ entries, for each timestamp, up to 500 tasks might be triggered.
cron
seems to add another entry point into your application, while Quartz
would integrate into it. So you would be forced to deal with some inter-process communication if you wanted to pass some information to/from the process invoked from cron
. In Quartz
you simply (hehe) run multiple threads.cron
is platform dependent, Quartz
is not.Quartz
may allow you to reliably make sure a task is run at the given time or some time after if the server was down for some time. Pure cron
wouldn't do it for you (unless you handle it manually).Quartz
has a more flexible language of expressing occurences (when the tasks should be fired). cron
approach. Quartz
might be used with Terracotta following the scaling out pattern (I haven't tried it, but I believe it's doable).If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With