springboot (spring) integrated quartz cluster

Mission requirements:

  Bank of Japan final timed run batches, beginning idea is to use the simplest way Timer task scheduling threads to run, but there is a problem, Timer scheduling, it can not be accurate time, because involves the problem of the cluster, so I finally took into account the quartz cluster

Quartz version:

  2.3.1

Quartz core elements:

Quartz core elements of task scheduling is: Scheduler-- task scheduler, Trigger-- trigger, Job-- task. Wherein the trigger is meta data and job task scheduling, scheduler controller is actually performed scheduling.

  Trigger is an element used to define the scheduled time, that is in accordance with the rules of what time to perform the task. Quartz offers four main types of trigger: SimpleTrigger, CronTirgger, DateIntervalTrigger, and NthIncludedDayTrigger. The four trigger meet most needs of enterprise applications.

  Job used to represent the task to be scheduled. There are two main types of job: stateless (Stateless) and stateful (stateful). For the same trigger, there are state job can not be executed in parallel, the task only after the last time the trigger is executed, the next time to trigger execution. Job There are two main attributes: volatility and durability, where volatility indicates whether the task is persisted to the database storage, while durability indicates whether the task is retained in the absence of trigger associated with it. Both are in the time value of true task is persistent or retained. A job can be associated with multiple trigger, but a trigger can only be associated with a job.

  Scheduler created by the scheduler factory:

 

DirectSchedulerFactory or StdSchedulerFactory. See a lot of information are based on these two do, this is directly from the factory interface to do SchedulerFactory.

Scheduler there are three:

RemoteMBeanScheduler, RemoteScheduler and StdScheduler. Also based interfaces do not apply directly to their 3 implementation.

text:

factory:

 

 

 

Guess you like

Origin www.cnblogs.com/hacker-lsr/p/12626457.html