Skip to content

Provide a general use TaskExecutor for background tasks #5082

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
philwebb opened this issue Feb 3, 2016 · 13 comments
Closed

Provide a general use TaskExecutor for background tasks #5082

philwebb opened this issue Feb 3, 2016 · 13 comments
Labels
status: duplicate A duplicate of another issue

Comments

@philwebb
Copy link
Member

philwebb commented Feb 3, 2016

Several parts of Spring Boot, and even more Spring Cloud could benefit from running tasks in the background or in parallel (see #5066 for example). It would be useful if we provided a common TaskExecutor so that threads could be shared.

@philwebb philwebb added this to the 1.4.0.M2 milestone Feb 3, 2016
@philwebb philwebb added the type: enhancement A general enhancement label Feb 3, 2016
@vpavic
Copy link
Contributor

vpavic commented Feb 3, 2016

👍

@snicoll
Copy link
Member

snicoll commented Feb 4, 2016

I have such a need on start.spring.io as well: I'd like to process events asynchronously and it would be nice if I could easily configure an Executor for that. Note that it's slightly different than this description. We would have to bind (somehow) that to @EnableAsync

@cemo
Copy link
Contributor

cemo commented Feb 27, 2016

👍

@spencergibb
Copy link
Member

Like @philwebb mentioned, spring-cloud has the need as well, see spring-cloud/spring-cloud-consul#146

@wilkinsona
Copy link
Member

@sunlin901203 As @snicoll already asked, please use Stack Overflow for this sort of question

@sunkolin
Copy link

sunkolin commented May 19, 2016

i only want to config a executor in application.properties. I do not want to use @EnableAsync and @Async and i do not want use

@Bean(name="taskExecutor")
public TaskExecutor taskExecutor() {
    ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor();
    taskExecutor.setMaxPoolSize(this.poolSize);
    taskExecutor.setQueueCapacity(this.queueCapacity);
    taskExecutor.afterPropertiesSet();
    return new ThreadPoolTaskExecutor();
}

too.i want config executor simple in application.properties like

<task:executor id="taskExecutor" pool-size="20" queue-capacity="20"/>

@philwebb philwebb added the for: team-attention An issue we'd like other members of the team to review label May 25, 2016
@philwebb philwebb removed this from the 1.4.0.RC1 milestone May 25, 2016
@philwebb philwebb removed the for: team-attention An issue we'd like other members of the team to review label May 25, 2016
@vpavic
Copy link
Contributor

vpavic commented May 31, 2016

Any feedback on the current status of this issue, considering it was recently removed from the 1.4.0.RC1?

@wilkinsona
Copy link
Member

It's something that we want to do, but it's not going to make it into 1.4

@vpavic
Copy link
Contributor

vpavic commented Jan 10, 2017

Are there any chances we'll see this in Boot 2.0? Thanks.

@philwebb
Copy link
Member Author

@vpavic Yeah, I'd love to see this in 2.0 but we won't get to it for a while. We've front loaded the 2.0 plan with all the reactive work and breaking changes (basically anything that we can't slip).

@philwebb philwebb added this to the Icebox milestone Jul 27, 2018
@joshiste
Copy link
Contributor

joshiste commented Jul 31, 2018

As with Spring 5.0.8 a new warning is logged, I guess more and more people would find a global AsyncTaskExecutor helpful (or at least one for Spring MVC) which can be configured via properties.

2018-07-31 07:38:43.246  WARN 55362 --- [nio-8080-exec-9] o.s.w.s.m.m.a.ReactiveTypeHandler        :
!!!
Streaming through a reactive type requires an Executor to write to the response.
Please, configure a TaskExecutor in the MVC config under "async support".
The SimpleAsyncTaskExecutor currently in use is not suitable under load.
-------------------------------
Controller:	de.codecentric.boot.admin.server.web.ApplicationsController
Method:		applicationsStream
Returning:	reactor.core.publisher.Flux<org.springframework.http.codec.ServerSentEvent<de.codecentric.boot.admin.server.web.ApplicationsController$Application>>
!!!

@joshiste
Copy link
Contributor

p.s. #1563 looks duplicate

@snicoll
Copy link
Member

snicoll commented Jul 31, 2018

Thanks @joshiste

Duplicate of #1563

@snicoll snicoll closed this as completed Jul 31, 2018
@snicoll snicoll added status: duplicate A duplicate of another issue and removed type: enhancement A general enhancement labels Jul 31, 2018
@snicoll snicoll removed this from the Icebox milestone Jul 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

8 participants