Skip to content
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

Fix gRPC to calculate the correct class name for method request and response types #7228

Merged
merged 3 commits into from
Aug 3, 2023

Conversation

thegridman
Copy link
Collaborator

The current code in the Grpc class assumes that the request and response types for methods will be in the same package as the Java package option in the service photo file. This is not always true because you can import types from other port files. For example in Coherence we import some base Google proto types like Empty.

I'm also curios whether line 128 where .setType is called in the code below is correct.

        io.grpc.MethodDescriptor.Builder<ReqT, ResT> grpcDesc = io.grpc.MethodDescriptor.<ReqT, ResT>newBuilder()
                .setFullMethodName(io.grpc.MethodDescriptor.generateFullMethodName(serviceName, methodName))
                .setType(io.grpc.MethodDescriptor.MethodType.UNARY).setFullMethodName(path).setRequestMarshaller(reqMarshaller)
                .setResponseMarshaller(resMarshaller).setSampledToLocalTracing(true);

This code always calls .setType(io.grpc.MethodDescriptor.MethodType.UNARY) but the actual method may not be unary.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jul 21, 2023
@thegridman thegridman added grpc 4.x Version 4.x labels Jul 21, 2023
tomas-langer
tomas-langer previously approved these changes Jul 31, 2023
@tomas-langer
Copy link
Member

The unary type is most likely wrong here.

@thegridman
Copy link
Collaborator Author

I added a change to set the correct method type

@tomas-langer tomas-langer merged commit bfec3c3 into helidon-io:main Aug 3, 2023
12 checks passed
@thegridman thegridman deleted the nima-grpc branch August 17, 2023 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x Version 4.x grpc OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants