From cd27dd9fd456db4113effc9e9af7b2bdc7d311ec Mon Sep 17 00:00:00 2001 From: Moritz Halbritter Date: Tue, 20 Feb 2024 09:35:59 +0100 Subject: [PATCH] Polish "Clarify that pool size properties are ignored with task executor" See gh-39629 --- .../asciidoc/features/task-execution-and-scheduling.adoc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/task-execution-and-scheduling.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/task-execution-and-scheduling.adoc index 3f69a73030ef..f238c9b96934 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/task-execution-and-scheduling.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/task-execution-and-scheduling.adoc @@ -37,9 +37,11 @@ This changes the thread pool to use a bounded queue so that when the queue is fu Shrinking of the pool is more aggressive as threads are reclaimed when they are idle for 10 seconds (rather than 60 seconds by default). A scheduler can also be auto-configured if it needs to be associated with scheduled task execution (using `@EnableScheduling` for instance). -When virtual threads are enabled (using Java 21+ and configprop:spring.threads.virtual.enabled[] set to `true`) this will be a `SimpleAsyncTaskScheduler` that uses virtual threads. -Otherwise, it will be a `ThreadPoolTaskScheduler` with sensible defaults. Note, the `SimpleAsyncTaskScheduler` will ignore any pool size properties. +If virtual threads are enabled (using Java 21+ and configprop:spring.threads.virtual.enabled[] set to `true`) this will be a `SimpleAsyncTaskScheduler` that uses virtual threads. +This `SimpleAsyncTaskScheduler` will ignore any pooling related properties. + +If virtual threads are not enabled, it will be a `ThreadPoolTaskScheduler` with sensible defaults. The `ThreadPoolTaskScheduler` uses one thread by default and its settings can be fine-tuned using the `spring.task.scheduling` namespace, as shown in the following example: [source,yaml,indent=0,subs="verbatim",configprops,configblocks]