Closed
Description
Sebastian Kirsch opened SPR-15566 and commented
The javadoc of @EnableAsync
states
By default, Spring will be searching for an associated thread pool definition: either a unique
org.springframework.core.task.TaskExecutor
bean in the context, or anjava.util.concurrent.Executor
bean named "taskExecutor" otherwise.
That is only partly true, since any java.util.concurrent.Executor
bean, no matter how it is named, will not be considered and the fallback SimpleAsyncTaskExecutor
will be used. I can provide a test case if that is debatable.
It would further be helpful to state that an AsyncConfigurer
takes precedence over any registered TaskExecutor
.
Affects: 4.3.8
Issue Links:
- Regression: Early instantiation of a bean prevents proxying for @Async in 4.2.x but works in 4.1.x [SPR-14030] #18602 Regression: Early instantiation of a bean prevents proxying for
@Async
in 4.2.x but works in 4.1.x - ScheduledAnnotationBeanPostProcessor should fall back to default TaskScheduler by name [SPR-13236] #17827 ScheduledAnnotationBeanPostProcessor should fall back to default TaskScheduler by name
- AsyncAnnotationBeanPostProcessor could find TaskExecutor by type/name [SPR-13248] #17839 AsyncAnnotationBeanPostProcessor could find TaskExecutor by type/name