Quartz学习——Quartz大致介绍(一)
定时任务执行框架quartz之时间配置参考以及Demo
<!--任务调度--> <dependency> <groupId>org.quartz-scheduler</groupId> <artifactId>quartz</artifactId> <version>2.2.1</version> </dependency>
任务调度框架Quartz系统参数配置详解
参数名
|
是否必须
|
类型
|
默认值
|
org.quartz.scheduler.instanceName
|
N
|
string
|
‘QuartzScheduler’
|
org.quartz.scheduler.instanceId
|
N
|
string
|
‘NON_CLUSTERED’
|
org.quartz.scheduler.instanceIdGenerator.class
|
N
|
string (class name)
|
org.quartz.simpl.SimpleInstanceIdGenerator
|
org.quartz.scheduler.threadName
|
N
|
string
|
instanceName+’_QuartzSchedulerThread’
|
org.quartz.scheduler.makeSchedulerThreadDaemon
|
N
|
boolean
|
false
|
org.quartz.scheduler.threadsInheritContextClassLoaderOfInitializer
|
N
|
boolean
|
false
|
org.quartz.scheduler.idleWaitTime
|
N
|
string
|
30000
|
org.quartz.scheduler.dbFailureRetryInterval
|
N
|
long
|
15000
|
org.quartz.scheduler.classLoadHelper.class
|
N
|
string (class name)
|
org.quartz.simpl.CascadingClassLoadHelper
|
org.quartz.scheduler.jobFactory.class
|
N
|
string (class name)
|
org.quartz.simpl.PropertySettingJobFactory
|
org.quartz.context.key.SOME_KEY
|
N
|
string
|
none
|
org.quartz.scheduler.userTransactionURL
|
N
|
string (url)
|
‘java:comp/UserTransaction’
|
org.quartz.scheduler.wrapJobExecutionInUserTransaction
|
N
|
boolean
|
false
|
org.quartz.scheduler.skipUpdateCheck
|
N
|
boolean
|
false
|
org.quartz.scheduler.batchTriggerAcquisitionMaxCount
|
N
|
int
|
1
|
org.quartz.scheduler.batchTriggerAcquisitionFireAheadTimeWindow
|
N
|
long
|
0
|
quartz.properties配置文件
##设置实例名 org.quartz.scheduler.instanceName = defaultScheduler #scheduler实例名称对应的id,必须全局唯一 org.quartz.scheduler.instanceId: default #设置为true,跳过检查更新,不会在程序运行中还去检查quartz是否有版本更新 org.quartz.scheduler.skipUpdateCheck: true ##Quartz线程池的配置 #指定线程池类 默认为null org.quartz.threadPool.class: org.quartz.simpl.SimpleThreadPool #线程数量,默认为-1 org.quartz.threadPool.threadCount: 5 #线程优先级范围1-10,默认为5 MIN_PRIORITY(1)-MAX_PRIORITY(10) 默认NORM_PRIORITY(5) org.quartz.threadPool.threadPriority: 5 # 单线程时,定时任务执行时间长度 减去 下次定时任务的开始时间 = 时间间隔 # 时间间隔 大于misfireThreshold/1000 会产生misfire org.quartz.jobStore.misfireThreshold: 600000