Skip to content

Blocking execution for WebFlux controller methods #30678

@rstoyanchev

Description

@rstoyanchev

This was raised and discussed under #21184, but closed with #21184 (comment) potentially to revisit for Loom.

We can enhance WebFuxConfigurer with options for blocking execution, e.g. to configure an AsyncTaskExecutor such as the new VirtualThreadTaskExecutor. The executor would be used to invoke synchronous controller methods, but we can also expose a Predicate for more fine-grained control over that decision.

An AsyncTaskExecutor if configured can also be used in places where we currently default Schedulers#boundedElastic such as DefaultPartHttpMessageReader and InMemoryWebSession to absorb blocking.

WebMvcConfigurer has analogous options, but in support of Servlet 3.1 asynchronous requests.

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions