-
Notifications
You must be signed in to change notification settings - Fork 782
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 transcoding is not working- unable to find annotation.proto and http.proto are thrown #1965
Comments
Either move the |
@JamesNK ,
|
@JamesNK did you get time to check the code I shared? Can you please help with this? |
I got it working after some changes. I changed the import in cache.proto:
And I change the import in annotations.proto:
And for some reason your http.proto was missing the message definition for CustomHttpPattern:
I'm guessing there was a mistake when copying the file from https://github.com/dotnet/aspnetcore/blob/33e2bca8af250a5e9d31060cbe14bbbda23ce3a7/src/Grpc/JsonTranscoding/test/testassets/Sandbox/google/api/http.proto#L369-L376 |
@JamesNK Thanks you very much. I have one more small doubt. When I have to share the proto files with the client then Should I send the protos folder fully as Zip file as the includes are also there? My second doubt is when generating the client should I remove the rest endpoints definition in proto or it will just be ignored |
It's ignored. |
@JamesNK Thank you for your quick response. I'm planning to deploy this in Kubernetes. Does that mean the gRPC request will communicate in one port and grpc-transcoding will communicate in another? The gRpc communication port is specified below in Program.cs below
});` similarly is there an option for me to specify the port where the transcoding will work? Should I change the above definition also to use Microsoft.AspNetCore.Server.Kestrel.Core.HttpProtocols.Http1AndHttp2? I want to avoid SSL negotiation issues Do I need to expose two different ports in the Kubernetes pod so that both gRpc transcoding and gRPC service work? My intention is that all the in-cluster communication should be in gRPC and all external communication (outside the cluster via LB or node port) should be through gRpc Transcoding |
It is up to you. If you are ok with calling RESTful JSON methods over prenegotiated HTTP/2 then you can reuse one port for both. Or add one that is Http1 only if you want to use HTTP/1.1. |
I'm trying to do gRpc Transcoding with .NET 7. I'm following the article here. I'm also referring to the sample implementation here. Ater I added the proto files (annotation.proto and http.proto) and include the annotations.proto to main proto file. I get the error
Rebuild started... 1>------ Rebuild All started: Project: CacheService, Configuration: Debug Any CPU ------ Restored C:\CarryCase\Venkatesh\M2c\grpc\net7\CacheService\CacheService.csproj (in 40 ms). 1>google/api/annotations.proto : error : File not found. 1>Protos/cache.proto(2,1): error : Import "google/api/annotations.proto" was not found or had errors. 1>Done building project "CacheService.csproj" -- FAILED. ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ========== ========== Elapsed 00:00.428 ==========
The code is attached herewith. I have already referred to similar solutions at this link and this link . But still the issue is not resolved
net7.zip
The text was updated successfully, but these errors were encountered: