Skip to content

Standardize application task executor 44946 #44965

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

Conversation

shivammm21
Copy link

This PR addresses issue #44946 by standardizing how applicationTaskExecutor is accessed across Spring integrations.

Problem

The current setup is complex with inconsistencies:

  • Spring MVC, WebFlux, and GraphQL all rely on a bean named applicationTaskExecutor but with different type requirements
  • Spring MVC and WebFlux require AsyncTaskExecutor
  • GraphQL uses a basic Executor
  • WebSocket and JPA have different lookup strategies

Solution

  • Enhanced ApplicationTaskExecutorBuilder with typed accessor methods:
    • getExecutor() - Returns basic Executor (suitable for GraphQL)
    • getAsyncTaskExecutor() - Returns AsyncTaskExecutor (for MVC, WebFlux, WebSocket)
    • getTaskExecutor() - Returns TaskExecutor (for other integrations)
  • Updated WebMVC and WebFlux configurations to use the builder pattern consistently
  • Improved error handling for cases when the executor isn't available
  • Added documentation explaining the standardized approach
  • Created README file with integration guidelines

This provides a more consistent, type-safe way to access the same underlying executor across all Spring Boot integrations while maintaining backward compatibility.

Fixes #44946

Signed-off-by: Shivam Thorat <shivamthorat2103@gmail.com>
This commit provides a more consistent way to access the applicationTaskExecutor bean across different Spring integrations by enhancing the ApplicationTaskExecutorBuilder. It updates MVC, WebFlux, and GraphQL to follow the same pattern, provides better type safety, and improves documentation.

Fixes spring-projects#44946

Signed-off-by: Shivam Thorat <shivamthorat2103@gmail.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Apr 1, 2025
@wilkinsona
Copy link
Member

Thanks for the PR, @shivammm21. I'm sorry to do this again, but we can't yet accept a contribution for this. #44946 has not yet be triaged and as the description states, it's not clear what needs to be done in some situations.

Thanks for your enthusiasm here. As I already recommended please comment on an issue and wait until it's assigned to you before working on a PR so that we can avoid wasted effort.

@wilkinsona wilkinsona closed this Apr 1, 2025
@wilkinsona wilkinsona added status: declined A suggestion or change that we don't feel we should currently apply and removed status: waiting-for-triage An issue we've not yet triaged labels Apr 1, 2025
@shivammm21
Copy link
Author

Yeah, I am really sorry, I will take care of it. I will change the code after I get assigned.
I will comment on it to assign me.
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: declined A suggestion or change that we don't feel we should currently apply
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Revisit how applicationTaskExecutor is utilized across various Spring integrations
3 participants