Skip to content

Associate the async service to the TaskExecutor  #12

@duntzer

Description

@duntzer

I think this example misses the association between the task executor and the service in an unfortunate way, i.e. how this is being set up (quote from the Javadoc): "By default, Spring will be searching for an associated thread pool definition: either a unique TaskExecutor bean in the context, or an Executor bean named "taskExecutor" otherwise. If neither of the two is resolvable, a SimpleAsyncTaskExecutor will be used to process async method invocations."

I think it could be beneficial for this guide, and for the possibility of using this code as a template, to add an explicit association between the executor and the async service by naming the executor bean and specifying the name of if in the @async annotation.

Otherwise I think it would be good to rename the the Executor bean to the expected name "taskExecutor"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions