You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Document that a bootstrap executor for the context is auto-configured
Document that `applicationTaskExecutor` as a bootstrap executor for the
context if no `bootstrapExecutor` bean is defined.
See gh-45232
Signed-off-by: Dmytro Nosan <[email protected]>
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/features/task-execution-and-scheduling.adoc
+8
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,7 @@ The auto-configured javadoc:org.springframework.core.task.AsyncTaskExecutor[] is
13
13
- Support for blocking execution in Spring WebFlux.
14
14
- Utilized for inbound and outbound message channels in Spring WebSocket.
15
15
- Acts as a bootstrap executor for JPA, based on the bootstrap mode of JPA repositories.
16
+
- Used as `bootstrapExecutor` for parallel bean initialization during startup, unless a `bootstrapExecutor` bean is defined.
16
17
17
18
While this approach works in most scenarios, Spring Boot allows you to override the auto-configured javadoc:org.springframework.core.task.AsyncTaskExecutor[].
18
19
By default, when a custom javadoc:java.util.concurrent.Executor[] bean is registered, the auto-configured javadoc:org.springframework.core.task.AsyncTaskExecutor[] backs off, and the custom javadoc:java.util.concurrent.Executor[] is used for regular task execution (via javadoc:org.springframework.scheduling.annotation.EnableAsync[format=annotation]).
The `applicationTaskExecutor` bean will also be used for regular task execution if there is no javadoc:org.springframework.context.annotation.Primary[format=annotation] bean or a bean named `taskExecutor` of type javadoc:java.util.concurrent.Executor[] or javadoc:org.springframework.scheduling.annotation.AsyncConfigurer[] present in the application context.
32
33
====
33
34
35
+
[NOTE]
36
+
====
37
+
The `applicationTaskExecutor` bean will be used for background bootstrapping if a bean named `bootstrapExecutor` is not defined.
38
+
Spring Boot registers an alias for the `applicationTaskExecutor` bean with the name `bootstrapExecutor` if a `bootstrapExecutor` bean is not already defined and `applicationTaskExecutor` is present in the context.
39
+
====
40
+
34
41
[WARNING]
35
42
====
36
43
If neither the auto-configured `AsyncTaskExecutor` nor the `applicationTaskExecutor` bean is defined, the application defaults to a bean named `taskExecutor` for regular task execution (javadoc:org.springframework.scheduling.annotation.EnableAsync[format=annotation]), following Spring Framework's behavior.
@@ -80,6 +87,7 @@ These integrations include:
80
87
- Spring WebFlux's blocking execution support.
81
88
- Utilized for inbound and outbound message channels in Spring WebSocket.
82
89
- Acts as a bootstrap executor for JPA, based on the bootstrap mode of JPA repositories.
90
+
- Used as the `bootstrapExecutor` for parallel bean initialization during startup, unless a `bootstrapExecutor` bean is explicitly provided.
0 commit comments