Skip to content

Provide a general use TaskExecutor for background tasks #5082

Closed

Description

@philwebb

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.

Activity

  1. added this to the 1.4.0.M2 milestone on Feb 3, 2016
  2. added
    type: enhancement
    on Feb 3, 2016
  3. vpavic commented on Feb 3, 2016

    @vpavic
    Contributor

    👍

  4. snicoll commented on Feb 4, 2016

    @snicoll
    Member

    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

  5. cemo commented on Feb 27, 2016

    @cemo
    Contributor

    👍

  6. spencergibb commented on Feb 27, 2016

    @spencergibb
    Member

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

  7. modified the milestones: 1.4.0.M3, 1.4.0.M2 on Apr 12, 2016
  8. modified the milestones: 1.4.0.RC1, 1.4.0.M3 on May 17, 2016
  9. wilkinsona commented on May 18, 2016

    @wilkinsona
    Member

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

  10. sunkolin commented on May 19, 2016

    @sunkolin

    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"/>
  11. added
    for: team-attention
    on May 25, 2016
  12. removed this from the 1.4.0.RC1 milestone on May 25, 2016
  13. removed
    for: team-attention
    on May 25, 2016
  14. vpavic commented on May 31, 2016

    @vpavic
    Contributor

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

  15. wilkinsona commented on Jun 1, 2016

    @wilkinsona
    Member

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

  16. vpavic commented on Jan 10, 2017

    @vpavic
    Contributor

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

  17. philwebb commented on Jan 18, 2017

    @philwebb
    MemberAuthor

    @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).

  18. added this to the Icebox milestone on Jul 27, 2018
  19. joshiste commented on Jul 31, 2018

    @joshiste
    Contributor

    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>>
    !!!
    
  20. joshiste commented on Jul 31, 2018

    @joshiste
    Contributor

    p.s. #1563 looks duplicate

  21. snicoll commented on Jul 31, 2018

    @snicoll
    Member

    Thanks @joshiste

    Duplicate of #1563

  22. added
    status: duplicate
    and removed
    type: enhancement
    on Jul 31, 2018
  23. removed this from the Icebox milestone on Jul 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: duplicate

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions