-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Warn about use of SimpleAsyncTaskExecutor for async requests [SPR-16203] #20751
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
Comments
Rossen Stoyanchev commented In the mean time applications can use |
Rossen Stoyanchev commented Adding 5.0.8 since this is a one-time warning in the logs. |
Michal Domagala commented Could you clarify whether or not WebMvcConfigurer#configureAsyncSupport is solution or workaround? I can't find any commit nor Jira ticket for more elegant configuration |
Rossen Stoyanchev commented To make sure we're talking about the same thing, this is only required when streaming to the response (e.g. Server-Sent Events, or application/stream+json) via This is not needed if you return a single value, such as |
Michal Domagala commented Yes we are talking about streaming case. I would like to say that usually Spring Boot configures automatically required infrastructure, so need to configure ThreadPoolTaskExecutor from scratch is not typical. If autoconfiguration is not possible, sample in documentation with default settings and/or good practice would be useful. |
Rossen Stoyanchev commented I believe something is being added to Boot for this. Stéphane Nicoll? |
Stéphane Nicoll commented As of today actually and available in the next milestone of Spring Boot 2.1, see #1563 for more details. There will be a In the meantime, I am afraid you'll have to implement |
Michal Domagala commented Great, big thanks! |
Uh oh!
There was an error while loading. Please reload this page.
Rossen Stoyanchev opened SPR-16203 and commented
The Spring MVC Java config and XML namespace allow configuring an
AsyncTaskExecutor
originally used forjava.util.concurrent.Callable
return values and by default aSimpleAsyncTaskExecutor
is used with the recommendation to configure a task executor with a thread pool for use under load.Now that the same executor is also used for blocking writes when streaming with
Flux
orObservable
, we should warn more proactively about this in the logs.Affects: 5.0.1
Issue Links:
@Bean
("depends on")Referenced from: commits 4b861ae, 7b3a72f, 7ea8ecb
The text was updated successfully, but these errors were encountered: