Quartz scheduler vs setting up cron

后端 未结 1 1717
悲哀的现实
悲哀的现实 2021-01-05 15:14

Was planning to move from setting up cron jobs to Quartz scheduler. What are the pros/cons of using Quartz rather than setting up cron ?

Got this Time triggered job

相关标签:
1条回答
  • 2021-01-05 15:35

    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. it is portable (can run on Win OS where no cron available)
    3. You can schedule multiple threads within quartz
    4. 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.
    5. 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.

    partially stolen from here

    0 讨论(0)
提交回复
热议问题