`

quartz Configuration

阅读更多

Quartz Enterprise Job Scheduler Configuration Reference

Configure Main Scheduler Settings

 

 

 

These properties configure the identification of the scheduler, and various other 'top level' settings.

Property Name Required Type Default Value
org.quartz.scheduler.instanceName no string 'QuartzScheduler'
org.quartz.scheduler.instanceId no string 'NON_CLUSTERED'
org.quartz.scheduler.instanceIdGenerator.class no string (class name) org.quartz.simpl.SimpleInstanceIdGenerator
org.quartz.scheduler.threadName no string instanceName + '_QuartzSchedulerThread'
org.quartz.scheduler.makeSchedulerThreadDaemon no boolean false
org.quartz.scheduler.threadsInheritContextClassLoaderOfInitializer no boolean false
org.quartz.scheduler.idleWaitTime no long 30000
org.quartz.scheduler.dbFailureRetryInterval no long 15000
org.quartz.scheduler.classLoadHelper.class no string (class name) org.quartz.simpl.CascadingClassLoadHelper
org.quartz.scheduler.jobFactory.class no string (class name) org.quartz.simpl.SimpleJobFactory
org.quartz.context.key.SOME_KEY no string none
org.quartz.scheduler.userTransactionURL no string (url) 'java:comp/UserTransaction'
org.quartz.scheduler.wrapJobExecutionInUserTransaction no boolean false
org.quartz.scheduler.skipUpdateCheck no boolean false

org.quartz.scheduler.instanceName 
Can be any string, and the value has no meaning to the scheduler itself - but rather serves as a mechanism for client code to distinguish schedulers when multiple instances are used within the same program. If you are using the clustering features, you must use the same name for every instance in the cluster that is 'logically' the same Scheduler.

org.quartz.scheduler.instanceId 
Can be any string, but must be unique for all schedulers working as if they are the same 'logical' Scheduler within a cluster. You may use the value "AUTO" as the instanceId if you wish the Id to be generated for you.

org.quartz.scheduler.instanceIdGenerator.class 
Only used if org.quartz.scheduler.instanceId is set to "AUTO". Defaults to "org.quartz.simpl.SimpleInstanceIdGenerator", which generates an instance id based upon host name and time stamp.

org.quartz.scheduler.threadName 
Can be any String that is a valid name for a java thread. If this property is not specified, the thread will receive the scheduler's name ("org.quartz.scheduler.instanceName") plus an the appended string '_QuartzSchedulerThread'.

org.quartz.scheduler.makeSchedulerThreadDaemon
A boolean value ('true' or 'false') that specifies whether the main thread of the scheduler should be a daemon thread or not. See also theorg.quartz.scheduler.makeSchedulerThreadDaemon property for tuning the SimpleThreadPool if that is the thread pool implementation you are using (which is most likely the case).

org.quartz.scheduler.threadsInheritContextClassLoaderOfInitializer
A boolean value ('true' or 'false') that specifies whether the threads spawned by Quartz will inherit the context ClassLoader of the initializing thread (thread that initializes the Quartz instance). This will affect Quartz main scheduling thread, JDBCJobStore's misfire handling thread (if JDBCJobStore is used), cluster recovery thread (if clustering is used), and threads in SimpleThreadPool (if SimpleThreadPool is used). Setting this value to 'true' may help with class loading, JNDI look-ups, and other issues related to using Quartz within an application server.

org.quartz.scheduler.idleWaitTime 
Is the amount of time in milliseconds that the scheduler will wait before re-queries for available triggers when the scheduler is otherwise idle. Normally you should not have to 'tune' this parameter, unless you're using XA transactions, and are having problems with delayed firings of triggers that should fire immediately.

org.quartz.scheduler.dbFailureRetryInterval 
Is the amount of time in milliseconds that the scheduler will wait between re-tries when it has detected a loss of connectivity within the JobStore (e.g. to the database). This parameter is obviously not very meaningful when using RamJobStore.

org.quartz.scheduler.classLoadHelper.class 
Defaults to the most robust approach, which is to use the "org.quartz.simpl.CascadingClassLoadHelper" class - which in turn uses every other ClassLoadHelper class until one works. You should probably not find the need to specify any other class for this property, though strange things seem to happen within application servers. All of the current possible ClassLoadHelper implementation can be found in the org.quartz.simpl package.

org.quartz.scheduler.jobFactory.class
The class name of the JobFactory to use. The default is 'org.quartz.simpl.SimpleJobFactory', you may like to try 'org.quartz.simpl.PropertySettingJobFactory'. A JobFatcory is responsible for producing instances of JobClasses. SimpleJobFactory simply calls newInstance() on the class. PropertySettingJobFactory does as well, but also reflectively sets the job's bean properties using the contents of the JobDataMap.

org.quartz.context.key.SOME_KEY 
Represent a name-value pair that will be placed into the "scheduler context" as strings. (see Scheduler.getContext()). So for example, the setting "org.quartz.context.key.MyKey = MyValue" would perform the equivalent of scheduler.getContext().put("MyKey", "MyValue").

InfoThe Transaction-Related properties should be left out of the config file unless you are using JTA transactions.

org.quartz.scheduler.userTransactionURL 
Should be set to the JNDI URL at which Quartz can locate the Application Server's UserTransaction manager. The default value (if not specified) is "java:comp/UserTransaction" - which works for almost all Application Servers. Websphere users may need to set this property to "jta/usertransaction". This is only used if Quartz is configured to use JobStoreCMT, and org.quartz.scheduler.wrapJobExecutionInUserTransaction is set to true.

org.quartz.scheduler.wrapJobExecutionInUserTransaction 
Should be set to "true" if you want Quartz to start a UserTransaction before calling execute on your job. The Tx will commit after the job's execute method completes, and after the JobDataMap is updated (if it is a StatefulJob). The default value is "false".

org.quartz.scheduler.skipUpdateCheck 
Whether or not to skip running a quick web request to determine if there is an updated version of Quartz available for download. If the check runs, and an update is found, it will be reported as available in Quartz's logs.

 

 

 

 

Configure ThreadPool Settings

Property Name Required Type Default Value
org.quartz.threadPool.class yes string (clas name) null
org.quartz.threadPool.threadCount yes int -1
org.quartz.threadPool.threadPriority no int Thread.NORM_PRIORITY (5)

org.quartz.threadPool.class 
Is the name of the ThreadPool implementation you wish to use. The threadpool that ships with Quartz is "org.quartz.simpl.SimpleThreadPool", and should meet the needs of nearly every user. It has very simple behavior and is very well tested. It provides a fixed-size pool of threads that 'live' the lifetime of the Scheduler.

org.quartz.threadPool.threadCount 
Can be any positive integer, although you should realize that only numbers between 1 and 100 are very practical. This is the number of threads that are available for concurrent execution of jobs. If you only have a few jobs that fire a few times a day, then 1 thread is plenty! If you have tens of thousands of jobs, with many firing every minute, then you probably want a thread count more like 50 or 100 (this highly depends on the nature of the work that your jobs perform, and your systems resources!).

org.quartz.threadPool.threadPriority 
Can be any int between Thread.MIN_PRIORITY (which is 1) and Thread.MAX_PRIORITY (which is 10). The default is Thread.NORM_PRIORITY (5).




 

 

分享到:
评论

相关推荐

    springboot 集成quartz

    亲测可用,springboot整合quartz。包含2个核心类QuartzConfiguration类和JobFactory类,修改数据库连接application和quartz.properties直接运行,访问http://localhost:8080/index。

    quartz

    quartz basic configuration

    Quartz_Scheduler_Configuration_Guide.pdf Version2.2.1

    Quartz_Scheduler_Configuration_Guide.pdf Version2.2.1

    Quartz.Net_2.2.4_支持多日志组件版本

    使用VS2010打开Quartz.Net35.sln或者Quartz.Net40.sln,且保证VS2010安装了nuget和Configuration Transform扩展包。 该扩展包都可以在微软官方网站http://visualstudiogallery.msdn.microsoft.com/找到

    Quartz 开发指南 中文版

    Quartz 开发指南 中文版 1. 第一课:使用Quartz 2. 第二课:Jobs And Triggers ...10. 第十课: Configuration, Resource 使用及SchedulerFactory 11. 第十一课: 高级(企业级)特性 12. 第十二课: 其他特性

    Quartz最全开发手册(中文版)

    10. 第十课: Configuration, Resource 使用及SchedulerFactory 11. 第十一课: 高级(企业级)特性 12. 第十二课: 其他特性 常见问题 一般问题 • Quartz是什么? • 为什么不使用java.util.Timer? • 如何build ...

    Quartz.HostedService:使用.Net Core通用服务和Quartz来实现后台计划任务

    PM> Install-Package Microsoft.Extensions.Configuration.Json PM> Install-Package Microsoft.Extensions.Logging.Console PM> Install-Package Microsoft.Extensions.Logging.Debug 在appsettings.json中编辑石英...

    springboot单体服务框架,拟集成quartz、Auth2认证、IM、ES、工作流等.zip

    2,使编码变得简单,SpringBoot采用 JavaConfig的方式对Spring进行配置,并且提供了大量的注解,极大的提高了工作效率,比如@Configuration和@bean注解结合,基于@Configuration完成类扫描,基于@bean注解把返回值...

    青锋管理系统是一个后台系统脚手架,使用springboot、layui前端框架、quartz定时任务.zip

    2,使编码变得简单,SpringBoot采用 JavaConfig的方式对Spring进行配置,并且提供了大量的注解,极大的提高了工作效率,比如@Configuration和@bean注解结合,基于@Configuration完成类扫描,基于@bean注解把返回值...

    quartz-hipster-entities

    石英时髦实体项目健康[ ]( )商标大图景这个简单的小型库的主要目的是使您在使用Quartz框架时更轻松。 主要功能可以分为3个部分。 让我解释它们中的每一个。 首先在实体包下定义石英框架使用的所有表。 您可以重用...

    spring-boot-reference.pdf

    39. Quartz Scheduler 40. Spring Integration 41. Spring Session 42. Monitoring and Management over JMX 43. Testing 43.1. Test Scope Dependencies 43.2. Testing Spring Applications 43.3. Testing Spring ...

    定时移除指定表的重复信息

    此模块使用的commons-configuration 来实现读取xml配置文件,使用quartz来实现定时任务,根据配置文件的配置信息来实现对指定表的信息重复数据的移除。

    event-job

    想在后台管理系统介面化管理Quartz Job上,就必须将所有Job Class引入管理系统中,但也强制系统成为Quartz Cluster之一,导致伺服器资源被Job占用,所以开发一套基于事件绑定的排程任务管理器,解决任务管理和任务...

    iOS技术概述

    System Configuration 框架 31 Core OS 层 31 Accelerate 框架 32 External Accessory 框架 32 Security 框架 32 System 33 从 Cocoa 迁移到 iOS 33 通用的迁移注意事项 33 迁移数据模型 34 迁移用户界面 34 内存...

    java-desktop-template

    出于实际原因,我试图介绍一些最流行的技术,例如 JPA(使用 Hibernate 实现)、Java Jobs(使用 Quartz)和用于 GUI 的 Swing。 java-se-desktop-template是一个用户和角色的管理系统,所以你会有一个管理下拉...

    由自锁模钛宝石激光器产生19 fs脉冲

    As short as 19 fs pulses are generated from a self mode-locked Ti: sapphire laser which consistS of a Ti: sapphire rod of 5 mm long, two quartz prisms and a Xcavity configuration. The intracavity ...

    tomcat8 + nginx + memcached + cas 实现负载均衡的配置包

    Configuration for the default TicketRegistry which stores the tickets in-memory and cleans them out as specified intervals. <!-- memcached 配置开始 --> <!-- Ticket Registry --> ...

    光抽运甲基氟远红外激光器

    The configuration and oscillation characteristics of the first optically pumped far infrared laser in our country are described. Transmissivity of far infrared optical materials at 496μm, such as ...

    基于最新的Java 21和SpringBoot 3.2 根据eladmin项目进行改造+源代码+文档说明

    - `unicorn-beans` 基础Beans的Definition及Configuration,To C业务可只引入该dependency - `unicorn-sys-api` Sys Module基础实体及API,方便服务拆分 - `unicorn-security` 系统权限模块,包含权限配置管理等。...

    Spring 2.0 开发参考手册

    13.11. 惯例优先原则(convention over configuration) 13.11.1. 对控制器的支持: ControllerClassNameHandlerMapping 13.11.2. 对模型的支持:ModelMap (ModelAndView) 13.11.3. 对视图的支持: ...

Global site tag (gtag.js) - Google Analytics