Skip to content

Consistently accept "taskExecutor" bean of type Executor (as stated in @EnableAsync's javadoc) [SPR-15566] #20125

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spring-projects-issues opened this issue May 19, 2017 · 1 comment
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented May 19, 2017

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 an java.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:

Referenced from: commits 3cc94ae, 9cb9884

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Our default executor lookup implementation was somewhat inconsistent: It accepted a "taskExecutor" bean of type Executor as a fallback if TaskExecutor beans were found but not unique; however, it did not accept such a "taskExecutor" bean on its own. I've revised this for 4.3.9 now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants