我是Quartz
的新手。我確實設法計算出Scheduler配置的默認值是org.quartz.threadPool.threadCount=-1
。什麼是石英默認線程數
但它沒有找到任何地方這意味着什麼。這是否意味着只有一個線程或有其他「號碼」?
我在玩quartz-scheduler v2.2。
我是Quartz
的新手。我確實設法計算出Scheduler配置的默認值是org.quartz.threadPool.threadCount=-1
。什麼是石英默認線程數
但它沒有找到任何地方這意味着什麼。這是否意味着只有一個線程或有其他「號碼」?
我在玩quartz-scheduler v2.2。
這取決於..
如果使用Spring Framework
然後就可以看到,真正的默認在SchedulerFactoryBean定義:
public static final int DEFAULT_THREAD_COUNT = 10;
在使用裸Quartz
和不傳遞任何財產的情況下,將使用其默認配置,您可以在org.quartz.properties:quartz
jar中找到它。這就是所謂的quartz.properties
(here's link),包含:
# Default Properties file for use by StdSchedulerFactory
# to create a Quartz Scheduler Instance, if a different
# properties file is not explicitly specified.
#
org.quartz.scheduler.instanceName: DefaultQuartzScheduler
org.quartz.scheduler.rmi.export: false
org.quartz.scheduler.rmi.proxy: false
org.quartz.scheduler.wrapJobExecutionInUserTransaction: false
org.quartz.threadPool.class: org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount: 10
org.quartz.threadPool.threadPriority: 5
org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread: true
org.quartz.jobStore.misfireThreshold: 60000
org.quartz.jobStore.class: org.quartz.simpl.RAMJobStore
所以,這是在大多數情況下。
在另一方面,如果你只是想不specyfying線程池大小創建SimpleThreadPool
,它將從initialize
方法拋出異常,因爲(here's link):
if (count <= 0) {
throw new SchedulerConfigException(
"Thread count must be > 0");
}
嘗試使用默認值org.quartz.threadPool.threadCount=-1
開始Quartz
它不啓動。你有org.quartz.SchedulerConfigException: Thread count must be > 0
默認-1
值強制你配置org.quartz.threadPool.threadCount
到你的值更0。
從jdoc
org.quartz.threadPool.threadCount
可以是任意正整數...
你是怎麼回答它希望,但馬切伊的答案是什麼我想知道,謝謝任何方式。 – Jef