Skip to content

Support server-streaming in transcoding - #284

Open
zZHorizonZz wants to merge 4 commits into
eclipse-vertx:mainfrom
zZHorizonZz:transcoding-streaming
Open

Support server-streaming in transcoding#284
zZHorizonZz wants to merge 4 commits into
eclipse-vertx:mainfrom
zZHorizonZz:transcoding-streaming

Conversation

@zZHorizonZz

Copy link
Copy Markdown
Member

Motivation:

  • Extend JSON transcoding support for server-streaming RPCs to enhance compatibility with streaming APIs.
  • Improve response flexibility with support for JSON Array, NDJSON, and SSE formats based on the Accept header.

Changes:

  • Added streaming and StreamFormat fields to TranscodingGrpcOutboundStream for response format negotiation.
  • Implemented JSON Array, NDJSON, and SSE response formatting for server-streaming.
  • Updated MessageWeaver to handle JsonObject outputs for request/response weaving.
  • Modified tests to validate new streaming response formats and HTTP transcoding logic.
  • Refactored templates (grpc-service.mustache) and tests to support method-level isManyOutput configurations.

@zZHorizonZz zZHorizonZz changed the title Enable JSON transcoding for server-streaming RPCs and refine response formatting Enable JSON transcoding for server-streaming RPCs Jun 30, 2026
@zZHorizonZz

Copy link
Copy Markdown
Member Author

This PR depends on #281

@zZHorizonZz zZHorizonZz changed the title Enable JSON transcoding for server-streaming RPCs Support server-streaming in transcoding Jul 1, 2026
@zZHorizonZz zZHorizonZz added this to the 5.2.0 milestone Jul 1, 2026
@zZHorizonZz
zZHorizonZz force-pushed the transcoding-streaming branch 2 times, most recently from 53c01e2 to 911fe6b Compare August 16, 2026 10:28
@zZHorizonZz
zZHorizonZz marked this pull request as ready for review August 16, 2026 11:24
@zZHorizonZz
zZHorizonZz requested a review from vietj August 16, 2026 15:32
@zZHorizonZz
zZHorizonZz force-pushed the transcoding-streaming branch 3 times, most recently from ef061fd to 857e4de Compare August 25, 2026 11:24
… formatting.

Motivation:

- Extend JSON transcoding support for server-streaming RPCs to enhance compatibility with streaming APIs.
- Improve response flexibility with support for JSON Array, NDJSON, and SSE formats based on the `Accept` header.

Changes:

- Added `streaming` and `StreamFormat` fields to `TranscodingGrpcOutboundStream` for response format negotiation.
- Implemented JSON Array, NDJSON, and SSE response formatting for server-streaming.
- Derived the streaming cardinality from `ServiceMethod#serverStreaming()`.
- Updated `MessageWeaver` to handle `JsonObject` outputs for request/response weaving.
- Modified tests to validate new streaming response formats and HTTP transcoding logic.

Signed-off-by: Daniel Fiala <danfiala23@gmail.com>
Motivation:

- The server-streaming transcoding formats were only covered by unit tests using hand-built service methods, leaving the protoc plugin path untested end to end.

Changes:

- Exercise the generated `StreamingTranscodingGreeter` service method over HTTP for the JSON array, NDJSON and SSE formats.
- Cover the empty stream and the coexistence of the transcoded and gRPC routes for the same method.

Signed-off-by: Daniel Fiala <danfiala23@gmail.com>
Motivation:

- `GrpcServer#addService` only registered the canonical `/package.Service/Method` path, so the HTTP rules of a transcoded service method were ignored and the transcoded routes returned a 500. `GrpcServer#callHandler` already mounts these paths.

Changes:

- Mount the `MountPoint` paths of a service method in `addService`, like `callHandler` does.
- Add integration tests binding a transcoded unary and server-streaming service with `addService`.

Signed-off-by: Daniel Fiala <danfiala23@gmail.com>
… message.

Motivation:

Transcoding defers the HTTP head until the response body is known, so writeHead returns a
promise resolved by writeUnaryMessage. A unary call that ends without ever writing a message
never resolves it and leaves the caller waiting.

Changes:

Resolve the head promise from writeEnd when it is still pending.

Fix the indentation of the SSE branch.
@zZHorizonZz
zZHorizonZz force-pushed the transcoding-streaming branch from 857e4de to 4a8f270 Compare August 25, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant