Quartz-job的quartz.properties配置文件说明

来源:互联网 发布:桌面软件下载大全 编辑:程序博客网 时间:2024/05/16 04:14

Quartz-Job的quartz.properties配置文件说明,此文件在quartz的jar包有,可直接拿过来使用不过只有基本的几个配置 自己可根据需要进行扩充;另外如果项目中没有对该配置文件重写,则Quartz会加载自己jar包中的quartz.properties文件。

[java] view plain copy
  1. # Default Properties file for use by StdSchedulerFactory  
  2. # to create a Quartz Scheduler Instance, if a different  
  3. # properties file is not explicitly specified.  
  4. #  
  5. # ===========================================================================  
  6. # Configure Main Scheduler Properties 调度器属性  
  7. # ===========================================================================  
  8. org.quartz.scheduler.instanceName: DefaultQuartzScheduler  
  9. #org.quartz.scheduler.instanceid:AUTO  
  10. org.quartz.scheduler.rmi.export: false  
  11. org.quartz.scheduler.rmi.proxy: false  
  12. org.quartz.scheduler.wrapJobExecutionInUserTransaction: false  
  13. # ===========================================================================    
  14. # Configure ThreadPool 线程池属性    
  15. # ===========================================================================  
  16. #线程池的实现类(一般使用SimpleThreadPool即可满足几乎所有用户的需求)  
  17. org.quartz.threadPool.class: org.quartz.simpl.SimpleThreadPool  
  18. #指定线程数,至少为1(无默认值)(一般设置为1-100直接的整数合适)  
  19. org.quartz.threadPool.threadCount: 10  
  20. #设置线程的优先级(最大为java.lang.Thread.MAX_PRIORITY 10,最小为Thread.MIN_PRIORITY 1,默认为5)  
  21. org.quartz.threadPool.threadPriority: 5  
  22. #设置SimpleThreadPool的一些属性  
  23. #设置是否为守护线程  
  24. #org.quartz.threadpool.makethreadsdaemons = false  
  25. #org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread: true  
  26. #org.quartz.threadpool.threadsinheritgroupofinitializingthread=false  
  27. #线程前缀默认值是:[Scheduler Name]_Worker  
  28. #org.quartz.threadpool.threadnameprefix=swhJobThead;  
  29. # 配置全局监听(TriggerListener,JobListener) 则应用程序可以接收和执行 预定的事件通知  
  30. # ===========================================================================  
  31. # Configuring a Global TriggerListener 配置全局的Trigger监听器  
  32. # MyTriggerListenerClass 类必须有一个无参数的构造函数,和 属性的set方法,目前2.2.x只支持原始数据类型的值(包括字符串)  
  33. # ===========================================================================  
  34. #org.quartz.triggerListener.NAME.class = com.swh.MyTriggerListenerClass  
  35. #org.quartz.triggerListener.NAME.propName = propValue  
  36. #org.quartz.triggerListener.NAME.prop2Name = prop2Value  
  37. # ===========================================================================  
  38. # Configuring a Global JobListener 配置全局的Job监听器  
  39. # MyJobListenerClass 类必须有一个无参数的构造函数,和 属性的set方法,目前2.2.x只支持原始数据类型的值(包括字符串)  
  40. # ===========================================================================  
  41. #org.quartz.jobListener.NAME.class = com.swh.MyJobListenerClass  
  42. #org.quartz.jobListener.NAME.propName = propValue  
  43. #org.quartz.jobListener.NAME.prop2Name = prop2Value  
  44. # ===========================================================================    
  45. # Configure JobStore 存储调度信息(工作,触发器和日历等)  
  46. # ===========================================================================  
  47. # 信息保存时间 默认值60秒  
  48. org.quartz.jobStore.misfireThreshold: 60000  
  49. #保存job和Trigger的状态信息到内存中的类  
  50. org.quartz.jobStore.class: org.quartz.simpl.RAMJobStore  
  51. # ===========================================================================    
  52. # Configure SchedulerPlugins 插件属性 配置  
  53. # ===========================================================================  
  54. # 自定义插件    
  55. #org.quartz.plugin.NAME.class = com.swh.MyPluginClass  
  56. #org.quartz.plugin.NAME.propName = propValue  
  57. #org.quartz.plugin.NAME.prop2Name = prop2Value  
  58. #配置trigger执行历史日志(可以看到类的文档和参数列表)  
  59. org.quartz.plugin.triggHistory.class = org.quartz.plugins.history.LoggingTriggerHistoryPlugin    
  60. org.quartz.plugin.triggHistory.triggerFiredMessage = Trigger {1}.{0} fired job {6}.{5} at: {4, date, HH:mm:ss MM/dd/yyyy}    
  61. org.quartz.plugin.triggHistory.triggerCompleteMessage = Trigger {1}.{0} completed firing job {6}.{5} at {4, date, HH:mm:ss MM/dd/yyyy} with resulting trigger instruction code: {9}    
  62. #配置job调度插件  quartz_jobs(jobs and triggers内容)的XML文档    
  63. #加载 Job 和 Trigger 信息的类   (1.8之前用:org.quartz.plugins.xml.JobInitializationPlugin)  
  64. org.quartz.plugin.jobInitializer.class = org.quartz.plugins.xml.XMLSchedulingDataProcessorPlugin  
  65. #指定存放调度器(Job 和 Trigger)信息的xml文件,默认是classpath下quartz_jobs.xml  
  66. org.quartz.plugin.jobInitializer.fileNames = my_quartz_job2.xml    
  67. #org.quartz.plugin.jobInitializer.overWriteExistingJobs = false    
  68. org.quartz.plugin.jobInitializer.failOnFileNotFound = true    
  69. #自动扫描任务单并发现改动的时间间隔,单位为秒  
  70. org.quartz.plugin.jobInitializer.scanInterval = 10  
  71. #覆盖任务调度器中同名的jobDetail,避免只修改了CronExpression所造成的不能重新生效情况  
  72. org.quartz.plugin.jobInitializer.wrapInUserTransaction = false  
  73. # ===========================================================================    
  74. # Sample configuration of ShutdownHookPlugin  ShutdownHookPlugin插件的配置样例  
  75. # ===========================================================================  
  76. #org.quartz.plugin.shutdownhook.class = \org.quartz.plugins.management.ShutdownHookPlugin  
  77. #org.quartz.plugin.shutdownhook.cleanShutdown = true  
  78. #  
  79. # Configure RMI Settings 远程服务调用配置  
  80. #  
  81. #如果你想quartz-scheduler出口本身通过RMI作为服务器,然后设置“出口”标志true(默认值为false)。  
  82. #org.quartz.scheduler.rmi.export = false  
  83. #主机上rmi注册表(默认值localhost)  
  84. #org.quartz.scheduler.rmi.registryhost = localhost  
  85. #注册监听端口号(默认值1099)  
  86. #org.quartz.scheduler.rmi.registryport = 1099  
  87. #创建rmi注册,false/never:如果你已经有一个在运行或不想进行创建注册  
  88. true/as_needed:第一次尝试使用现有的注册,然后再回来进行创建  
  89. # always:先进行创建一个注册,然后再使用回来使用注册  
  90. #org.quartz.scheduler.rmi.createregistry = never  
  91. #Quartz Scheduler服务端端口,默认是随机分配RMI注册表  
  92. #org.quartz.scheduler.rmi.serverport = 1098  
  93. #true:链接远程服务调度(客户端),这个也要指定registryhost和registryport,默认为false  
  94. # 如果export和proxy同时指定为true,则export的设置将被忽略  
  95. #org.quartz.scheduler.rmi.proxy = false  
由于英语不太好,有些部分读起来有些生涩,请见谅,有不对的部分麻烦跟帖指出。

关于jdbc和数据库集群部分等有空了再整理下贴出来,文档官网地址:http://www.quartz-scheduler.org/documentation/quartz-2.2.x/configuration/

0 0
原创粉丝点击