JavaQuartz Job persistence

前端 未结 3 1450
滥情空心
滥情空心 2021-01-12 03:18

I am not much familiar with Java Quartz, we just used a test job thats scheduled daily. For our Struts2 webapplication, we want to run a few daily jobs that are scheduled at

相关标签:
3条回答
  • 2021-01-12 03:26

    We have Job stores api in Java Quartz. This will persist data in the databases about the information of the Job. So i guess this will help you. You can check this link to get an idea about code and DB structure.

    0 讨论(0)
  • 2021-01-12 03:30

    Whatever you have mentioned is possible in Quartz scheduler and there is already a feature with triggers which we generally call Misfire Instructionsthis is what doc say about it

    Another important property of a Trigger is its "misfire instruction". A misfire occurs if a persistent trigger "misses" its firing time because of the scheduler being shutdown, or because there are no available threads in Quartz's thread pool for executing the job. The different trigger types have different misfire instructions available to them. By default they use a 'smart policy' instruction - which has dynamic behavior based on trigger type and configuration. When the scheduler starts, it searches for any persistent triggers that have misfired, and it then updates each of them based on their individually configured misfire instructions. When you start using Quartz in your own projects, you should make yourself familiar with the misfire instructions that are defined on the given trigger types, and explained in their JavaDoc. More specific information about misfire instructions will be given within the tutorial lessons specific to each trigger type.

    Regarding Job persistence Quartz comes with few build in mechanism and all you need to set JobStore as JDBCJobStore

    I suggest you to go with Quartz scheduler document its quite easy and have lots of tutorial and examples to start with.

    If you are not using Spring in your application there is no need to add extra level of abstraction and dependencies.

    0 讨论(0)
  • 2021-01-12 03:32

    You can use Quartz combined with Sprig batch.

    The former provides API for managing various flows (as complex as you need), persistent storage of job state and api for monitoring and re-running jobs according to their execution status. Another handy library is Spring Batch admin. It has web console and 5 minutes guide.

    Quartz is used as scheduler job state persistence is handled by Spring batch.. It can run as standalone java application and also in web/application container (for me Tomcat was enough).

    Good luck!

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