I have a single protobuf which generates out C# and Go code.
The protobuf contains:
syntax = "proto3";
package myprotobuf;
option go_package = "gitlab.example.com/mycompany/myprotobuf.git";
I'm using go-micro and protoc-gen-micro for my Go GRPC. I'm using Go modules for my Go packages. I'm pushing generated Go code to my protobuf repository for a few reasons: (a) Git submodules can be painful to work with (b) a protobuf referencing a type in an external package requires that external package to have a defined absolute package URL and (c) that's how Google do it (ref e.g. structpb) so it seems like that's the "standard".
The C# server / client generated from that proto serve / hit an endpoint at "/myprotobuf.Service/Method", and work fine.
GRPC_TRACE for C# gives:
Decode: ':path: /myprotobuf.Service/Method', elem_interned=1 [1], k_interned=1, v_interned=1 (edited)
The Go / go-micro client calling the C# server gives:
Decode: ':path: /myprotobuf.git.Service/Method', elem_interned=0 [2], k_interned=1, v_interned=0
followed by an error. Note that the path is different. Breakpoints and Console.WriteLine's in the C# GRPC handler never get hit, which makes sense since we're not hitting a known endpoint.
What's the solution for this?
go get
seems to require the .git at the end of the package URL.- go modules require the "module" and "package" definitions to match the URL.
- C# won't like a "." in the namespace.
So it seems like Go and C# are both always going to prefix the endpoint with what the think the package / namespace is, and they're never going to agree on what the package / namespace should be.
Is there a way to override the namespace prefixed to the GRPC endpoint?