spring-projects / spring-framework

Spring Framework
https://spring.io/projects/spring-framework
Apache License 2.0
55.27k stars 37.62k forks source link

Provide more ways to stream through ServerResponse for WebMvc functional endpoints #32710

Open rstoyanchev opened 3 weeks ago

rstoyanchev commented 3 weeks ago

Currently it's possible to stream SSE events via ServerResponse.sse(Consumer<SseBuilder>), but no way to stream in any other format, comparable to the ResponseBodyEmitter base class of SseEmitter for annotated controller methods.

For extra context, the GraphQL spec is finalizing an incremental delivery feature that prioritizes some parts of the response data and sends them before others. Over HTTP this is expected to be a "mixed/multipart" stream.