What is the default scheduler pool size in spring-boot?

前端 未结 5 1087
栀梦
栀梦 2020-12-05 09:53

I\'m using spring-boot and @Scheduled annotation to execute some tasks.

How can I find out what the default pool size of scheduled tasks is

5条回答
  •  感动是毒
    2020-12-05 10:15

    The default pool size is 1, and you can set the pool size in application.properties science springboot2.1.0 via changing the value of spring.task.scheduling.pool.size.

    spring.task.scheduling.pool.size=20
    

    The same task will be executed in serialized when the trigger period is shorter than the execution duration. And Spring Boot will execute different tasks in parallel with a maximum of 20 threads.

提交回复
热议问题