2013-02-20 50 views
4

我有一個Spring應用一些預定的任務,他們都配置是這樣的:什麼是未指定時使用的默認「org.quartz.threadPool.threadCount」?

<bean id="scheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> 
    <property name="triggers"> 
     <list> 
      <!-- Here the list of tasks -->    
     </list> 
    </property>  
</bean> 

我有一些問題(有些任務不運行時,他們應該,但不能永遠只是一個很長一段時間後,或在某些時候),我認爲這可能是因爲有很多任務(迄今爲止有11個),系統無法同時運行它們。我曾經想過設定org.quartz.threadPool.threadCount這樣來增加並行線程數:

<bean id="scheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> 
    <property name="triggers"> 
     <list> 
      <!-- Here the list of tasks -->    
     </list> 
    </property> 
    <property name="quartzProperties"> 
     <props> 
      <prop key="org.quartz.threadPool.threadCount">15</prop> 
     </props> 
    </property>  
</bean> 

但我不知道,有多少線程是在我沒有設置org.quartz.threadPool.threadCount財產使用該系統?什麼是默認行爲?

回答

6

當使用Google 「SchedulerFactoryBean.java」 第一連桿(SchedulerFactoryBean.java)與源代碼我打開有:

public static final int DEFAULT_THREAD_COUNT = 10; 

該值在initSchedulerFactory後來用於設置org.quartz.threadPool.threadCount方法:

mergedProps.setProperty(PROP_THREAD_COUNT, Integer.toString(DEFAULT_THREAD_COUNT)); 
相關問題