Skip to content

Auto-configure a sensible TaskExecutor #1563

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
BigMichi1 opened this issue Sep 16, 2014 · 3 comments
Closed

Auto-configure a sensible TaskExecutor #1563

BigMichi1 opened this issue Sep 16, 2014 · 3 comments
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@BigMichi1
Copy link
Contributor

it would be really nice if spring-boot has an auto-configuration for the AsyncTaskExecutor. So if an @EnableAsync is found a AsyncTaskExecutor bean is provided based on the environment. If there is support for jsr236 (e.g. wildfly) the DefaultManagedTaskExecutor is used by looking in jndi and when not a ThreadPoolTaskExecutor or a SimpleAsyncTaskExecutor is used.

Perhaps this can be combined with the @EnableScheduling configuration

@philwebb
Copy link
Member

See also #1397

@philwebb philwebb added the type: enhancement A general enhancement label Sep 16, 2014
@philwebb
Copy link
Member

@snicoll Did we discuss this briefly already? any thoughts?

@snicoll
Copy link
Member

snicoll commented Sep 16, 2014

I don't think we did but if we feel we should change Spring's own defaults we should just do it. This may require a larger discussion though (as mentioned by your link)

@philwebb philwebb added the status: ideal-for-contribution An issue that a contributor can help us with label Sep 23, 2014
@snicoll snicoll removed the status: ideal-for-contribution An issue that a contributor can help us with label Apr 24, 2016
@philwebb philwebb added this to the Backlog milestone Mar 22, 2018
@snicoll snicoll self-assigned this Aug 1, 2018
snicoll added a commit to snicoll/spring-boot that referenced this issue Aug 2, 2018
This commit adds support for configuring a ThreadPoolTaskExecutor as
well as auto-configuration when it makes sense.

A ThreadPoolTaskExecutor can be easily built using TaskExecutorBuilder
that is available as a bean. The default builder can be initialized
using the `spring.task.*`namespace.

As the necessary classes to setup such pool are always present, only
the builder is made available by default. If `@EnableAsync` is detected
and no TaskExecutor was configured, the one produced by the builder is
exposed automatically.

See spring-projectsgh-1563
@snicoll snicoll changed the title Autoconfig for AsyncTaskExecutor Auto-configure a sensible TaskExecutor Aug 6, 2018
@snicoll snicoll closed this as completed in c071f34 Aug 6, 2018
@snicoll snicoll modified the milestones: Backlog, 2.1.0.M2 Aug 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants