Skip to content

Make it possible to stream "application/grpc" in Spring MVC via Flux<T> #35401

@rstoyanchev

Description

@rstoyanchev

It is possible with ResponseBodyEmitter, but for Flux, given that message converters are used for individual items, it is necessary to know the streaming format in order to also insert any required delimiters. This why only specific media types are supported such as SSE, newline-delimited JSON, and plain text.

In contrast, the same is possible in WebFlux where an HttpMessageWriter handles the whole Flux and can make decisions for the full output.

In gRPC streaming, each Protobuf message includes a content-length, so there is no need for delimiters. It should be easy to plug it into our existing Flux support.

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