spring thread pool configuration

<bean id="threadPool" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
        <!-- number of core threads -->
        <property name="corePoolSize" value="20" />
        <!-- maximum Number of threads -->
        <property name="maxPoolSize" value="80" />
        <!-- maximum queue length>=mainExecutor.maxSize -->
        <property name="queueCapacity" value="5000" />
        <! -- The idle time allowed by the thread pool maintenance thread-->
        <property name="keepAliveSeconds" value="300" />
        <!-- The thread pool's processing strategy for rejected tasks (no threads available)-->
        <property name="rejectedExecutionHandler">
            <bean class="java.util.concurrent.ThreadPoolExecutor$CallerRunsPolicy" />
        </property>
    </bean>

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326686878&siteId=291194637