-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
grpc - added grpc transcoding feature #40254
base: main
Are you sure you want to change the base?
Conversation
6556e2a
to
d5de72a
Compare
This comment has been minimized.
This comment has been minimized.
🎊 PR Preview 79af515 has been successfully built and deployed to https://quarkus-pr-main-40254-preview.surge.sh/version/main/guides/
|
This comment has been minimized.
This comment has been minimized.
5db21ba
to
2fb227c
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
2fb227c
to
f8c4472
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why these changes are here. I think when I ran optimize imports on the entire gRPC folder, it might be the cause. However, the changes might improve the code by removing unnecessary spaces and tabs, so I think this could be kept since I don't think any formatting is done on js by quarkus build anyway.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
f8c4472
to
6af757f
Compare
This comment has been minimized.
This comment has been minimized.
6af757f
to
9b674ac
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
778e2de
to
94c0bc3
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@zZHorizonZz does plain gRPC also work along with this transcoding? Both old |
Do you mean if a separate server is on? Honestly, I haven't tested that specifically since I forgot about that (I will try to add some tests for it). However, basic gRPC with a separate server turned off works properly you can see that in the HelloWorldTranscodingEndpointTest where it calls the endpoint, and that then calls the client. It's similar to the other gRPC integration tests. |
If you could add test(s) for all But on another note, I feel as having a whole new |
Now that I think about it, since I copied the grpc-vertx integration tests and mostly left the application.properties file the same. My question is when running JVM tests goal, does it run profiles that are specified in properties file? Are they specified somewhere? The properties file includes vertx, n2o, and o2n profiles, which (if used) should test everything with the separate server both on and off. |
The test then needs to have this profile enabled, see existing tests that have this.
|
I wanted to reuse as much as possible from the Vert.x gRPC implementation, but as I got further I started running into issues. It comes down pretty much to decoding and encoding. Basically GrpcServerImpl creates a GrpcServerRequestImpl and uses the GrpcMessageDecoder and GrpcMessageEncoder for its parameters, like this: new MethodCallHandler<>(methodDesc, GrpcMessageDecoder.unmarshaller(methodDesc.getRequestMarshaller()), GrpcMessageEncoder.marshaller(methodDesc.getResponseMarshaller()), handler)); And then these parameters are passed to GrpcServerRequestImpl like this: new GrpcServerRequestImpl<>(httpRequest, method.messageDecoder, method.messageEncoder, methodCall); The problem is that I can't directly use these decoders and encoders for gRPC and decode and encode json with them. Furthermore, I need to merge route and query parameters into the payload, which is done by GrpcTranscodingRequest. |
Status for workflow
|
Status for workflow
|
Status | Name | Step | Failures | Logs | Raw logs | Build scan |
---|---|---|---|---|---|---|
✖ | MicroProfile TCKs Tests | Verify |
Failures | Logs | Raw logs | 🔍 |
Full information is available in the Build summary check run.
You can consult the Develocity build scans.
Failures
⚙️ MicroProfile TCKs Tests #
- Failing: tcks/microprofile-opentelemetry
📦 tcks/microprofile-opentelemetry
✖ org.eclipse.microprofile.telemetry.tracing.tck.async.JaxRsClientAsyncTest.testIntegrationWithJaxRsClientAsync
- History - More details - Source on GitHub
java.util.concurrent.RejectedExecutionException: event executor terminated
at io.netty.util.concurrent.SingleThreadEventExecutor.reject(SingleThreadEventExecutor.java:934)
at io.netty.util.concurrent.SingleThreadEventExecutor.offerTask(SingleThreadEventExecutor.java:351)
at io.netty.util.concurrent.SingleThreadEventExecutor.addTask(SingleThreadEventExecutor.java:344)
at io.netty.util.concurrent.SingleThreadEventExecutor.execute(SingleThreadEventExecutor.java:836)
at io.netty.util.concurrent.SingleThreadEventExecutor.execute0(SingleThreadEventExecutor.java:827)
at io.netty.util.concurrent.SingleThreadEventExecutor.execute(SingleThreadEventExecutor.java:817)
at io.vertx.core.impl.EventLoopExecutor.execute(EventLoopExecutor.java:35)
@alesj I'm a bit confused about what you meant with old2new, new2old, etc as there isn't really anything that I could categorize as "old" there are only new things from my point of view. |
We have tests that check all 4 combinations - matrix between io.grpc and our Vert.x gRPC. But this won't change the fact that we need to get this into Vert.x, and not into Quarkus gRPC, |
I agree with that. I will try to open an issue on vertx-grpc and try to figure out how this could be done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that most of this code should to into Vert.x gRPC server and not in Quarkus.
Duplicating the gRPC server is going to be a non-meaningless maintenance burden. We already have the legacy and old one to maintain, having a third might not be the best idea.
Marking it as on-ice. The feature is super interesting, but we need to find a proper way to implement it. We may need to tweak things in Vert.x to avoid code duplication. |
This pull request introduces grpc transcoding functionality, extending API accessibility by allowing grpc services to be called via HTTP requests as proposed here #25837. This implementation follows grpc transcoding described by Google Cloud grpc transcoding documentation, as I was not able to find If there is currently official grpc standard for this feature.
Example Usage:
This configuration will enable quarkus to expose a new HTTP route at
/v1/simple
. HTTP requests to this route will be translated into calls to the underlyingSimplePath
grpc method. More detailed description can be seen here.(Sorry for the previous PR. I had some trouble squashing commits, and after my force push, the bot added almost all of the labels)