Skip to content

Add request timeout to ResponseBodyEmitter [SPR-13104] #17695

Closed
@spring-projects-issues

Description

@spring-projects-issues

Bernhard Frauendienst opened SPR-13104 and commented

As discussed in #16826, request handler methods returning a ResponseBodyEmitter (or a subclass like SseEmitter) have no way of specifying a request-specific timeout to be set on the request's AsyncContext. The only way to specify that timeout is using the global default value.

However, most ResponseBodyEmitter connections are explicitly created to be long-running, especially in the Server-Sent Event case (SseEmitter), where the connection is created as an async back-channel to the client.
As such, those request handlers will in most cases want to set a much higher timeout value than the one appropriate for single-result async tasks.

Therefore, the possibility to specify a per-request timeout value should be added to the ResponseBodyEmitter (probably similar to the property in DeferredResult).


Affects: 4.2 RC1

Issue Links:

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