> On 31 May 2021, at 7:13 pm, David Wang <[email protected]> wrote:
> 
> Hi all,
> 
> I develop a gate to transfer message from different clients to micro 
> services. However, I dont want to change my gate when service rpc has been 
> changed. So my client give the method name and protobuf information ([]byte) 
> to gate, the gate dont have the .proto.go file and just want to use this 
> completed information to call the right gRPC method. I cant find the right 
> API to realize it.
> Like: client.Conn().Invoke(ctx, {methodName}, {protobuf marshal by client}, 
> bytes)

You will need to make use of server reflection: 
https://github.com/grpc/grpc-go/blob/master/Documentation/server-reflection-tutorial.md
 
<https://github.com/grpc/grpc-go/blob/master/Documentation/server-reflection-tutorial.md>

For server, it’s simple to enable it.

For client (i.e in your gate), have a look at 
http://google.golang.org/grpc/reflection/grpc_reflection_v1alpha 
<http://google.golang.org/grpc/reflection/grpc_reflection_v1alpha> to make use 
of the reflection feature to lookup methods/construct protobuf messages and 
others.



> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "grpc.io" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/grpc-io/f4639a89-381a-4c47-8af3-582cd842f3f4n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/grpc-io/f4639a89-381a-4c47-8af3-582cd842f3f4n%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/E52DB2E7-E0BF-4D16-A8EA-5B6D607737CC%40gmail.com.

Reply via email to