Does spring @Scheduled annotated methods runs on different threads?

前端 未结 8 2364
时光取名叫无心
时光取名叫无心 2020-11-30 01:19

I have several methods annotated with @Scheduled(fixedDelay=10000).

In the application context, I have this annotation-driven setup:

<         


        
8条回答
  •  天涯浪人
    2020-11-30 01:33

    The documentation about scheduling says:

    If you do not provide a pool-size attribute, the default thread pool will only have a single thread.

    So if you have many scheduled tasks, you should configure the scheduler, as explained in the documentation, to have a pool with more threads, to make sure one long task doesn't delay all the other ones.

提交回复
热议问题