Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the default "org.quartz.threadPool.threadCount" used when it is not specified any?

I have some scheduled tasks in a Spring application and they were configured like this:

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

I'm having some issues (some tasks doesn't run when they should but not always just after a long time or at certain times) and I think it may be because there are many tasks (11 so far) and the system can't run them at the same time. I have thought of setting org.quartz.threadPool.threadCount like this to increment the number of parallel threads:

<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>

But I wonder, how many threads was the system using when I was not setting the org.quartz.threadPool.threadCount property? What is the default behaviour?

like image 656
Javi Avatar asked Feb 20 '13 12:02

Javi


1 Answers

When googling "SchedulerFactoryBean.java" first link(SchedulerFactoryBean.java) with source code i opened had:

public static final int DEFAULT_THREAD_COUNT = 10;

This value is used later to set org.quartz.threadPool.threadCount in initSchedulerFactory method:

mergedProps.setProperty(PROP_THREAD_COUNT, Integer.toString(DEFAULT_THREAD_COUNT));
like image 79
efan Avatar answered Sep 28 '22 06:09

efan