Decouple gRPC server implementation from the actual invocation layer#245
Open
Decouple gRPC server implementation from the actual invocation layer#245
Conversation
Member
Author
|
@zZHorizonZz ping |
zZHorizonZz
reviewed
Mar 14, 2026
vertx-grpc-server/src/main/java/io/vertx/grpc/server/impl/HttpGrpcOutboundInvoker.java
Outdated
Show resolved
Hide resolved
| 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) { |
Member
There was a problem hiding this comment.
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"); |
Member
There was a problem hiding this comment.
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?
vertx-grpc-server/src/main/java/io/vertx/grpc/server/impl/HttpGrpcOutboundInvoker.java
Outdated
Show resolved
Hide resolved
vertx-grpc-server/src/main/java/io/vertx/grpc/server/impl/WebGrpcOutboundStream.java
Show resolved
Hide resolved
vertx-grpc-client/src/main/java/io/vertx/grpc/client/impl/SetIdleTimeoutFrame.java
Show resolved
Hide resolved
b7db112 to
caf1051
Compare
… layer. Motivation: GrpcServerResponseImpl is tightly coupled to the underlying invocation layer. Changes: Isolate invocation layer response handling in a separate class hierarchy.
…#sendEnd" This reverts commit 725bc1a.
…at is not trailers only
c1a3dc0 to
daeaa8c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
Implementation:
GrpcServerResponseimplementation from invocation layer and HTTPGrpcServerRequestimplementation from invocation layer and HTTP