Skip to content

Decouple gRPC server implementation from the actual invocation layer#245

Open
vietj wants to merge 55 commits intomainfrom
invocation-proto-2
Open

Decouple gRPC server implementation from the actual invocation layer#245
vietj wants to merge 55 commits intomainfrom
invocation-proto-2

Conversation

@vietj
Copy link
Member

@vietj vietj commented Mar 13, 2026

Motivation:

The request/response API is coupled to the gRPC transport implementations leading to the usage of subclasses.

We would like to have this API independent of the actual transport for several reasons:

  • simplify / untangle the interactions between the request/response API and the protocol semantics
  • enable new transports, not HTTP based such as Vert.x event-bus
  • enable transport level interception

Implementation:

  • decouple GrpcServerResponse implementation from invocation layer and HTTP
  • decouple GrpcServerRequest implementation from invocation layer and HTTP
  • simplify
  • decouple invocation layer from HTTP transport

@vietj vietj added this to the 5.1.0 milestone Mar 13, 2026
@vietj vietj marked this pull request as draft March 13, 2026 06:44
@vietj vietj changed the title Decouple GrpcServerResponse implementation from the actual invocation layer. Decouple gRPC server implementation from the actual invocation layer Mar 13, 2026
@vietj
Copy link
Member Author

vietj commented Mar 13, 2026

@zZHorizonZz ping

public GrpcDeframingStream(ContextInternal ctx, ReadStream<Buffer> stream, GrpcMessageDeframer deframer) {
this.stream = stream;
this.deframer = deframer;
this.queue = new InboundMessageQueue<>(ctx.executor(), ctx.executor(), 8, 16) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we extract the 8, 16 to static field? So that it is more cleaner at first glance by names of the fields what these numbers mean/do?

public final class GrpcServerResponseImpl<Req, Resp> extends GrpcWriteStreamBase<GrpcServerResponseImpl<Req, Resp>, Resp> implements GrpcServerResponse<Req, Resp> {

private static final Pattern COMMA_SEPARATOR = Pattern.compile(" *, *");
private static final Set<String> GZIP_ACCEPT_ENCODING = Collections.singleton("gzip");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be used across classes where we are setting headers and suchs for example in Http2GrpcClientInvokerResolver or make this publicly accessible by general somewhere?

@vietj vietj force-pushed the invocation-proto-2 branch 2 times, most recently from b7db112 to caf1051 Compare March 16, 2026 07:09
@vietj vietj marked this pull request as ready for review March 16, 2026 07:25
@vietj vietj force-pushed the invocation-proto-2 branch from c1a3dc0 to daeaa8c Compare March 17, 2026 08:49
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.

2 participants