Skip to content

@Async groups [SPR-9318] #13956

Closed
Closed
@spring-projects-issues

Description

@spring-projects-issues

Bozhidar Bozhanov opened SPR-9318 and commented

Currently all @Async methods are executed using the same thread pool. But often you need different groups of related async operations and you don't want them to share the same pool. For example, a scheduled job may want to asynchronously invoke a method multiple times, but if it uses @Async it will consume all the threads that are supposed to be used by other processes.

That's why I suggest to add an async group. @Async(group="main"), @Async(group="calculations"), etc. Each of them will have a separate pool.

<task:executor id="mainExecutor" pool-size="100" group="main" />
<task:executor id="calcExecutor" pool-size="20" group="calculations" />
<task:annotation-driven executors="mainExecutor,calcExecutor" /> (or a nested <list>)


Affects: 3.1.1

Issue Links:

1 votes, 1 watchers

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: coreIssues in core modules (aop, beans, core, context, expression)status: duplicateA duplicate of another issuetype: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions