Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

standard way to discover gRPC service

Tags:

grpc

What is the standard way for a remote client to discover available services on gRPC server? I know there is something called gRPC reflection. But how do we use it? I am looking for language agnostic solution (provided gRPC support)

like image 510
leopoodle Avatar asked Oct 11 '25 07:10

leopoodle


1 Answers

I see that my answer can be useless looking at the date of the question.

As far as I understand browsing log files and deploying reflection feature, a grpc client sends POST request /grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo using HTTP/2.0 protocol to grpc server to receive the list of exposed services and their methods, for instance:

$ grpcurl --plaintext host:8000 list
grservices.diagnostic
$ ~/gopath/bin/grpcurl --plaintext host:8000 list grservices.diagnostic
GetDateTime
GetTimeZones

Log:

"POST /grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo HTTP/2.0"
"POST /grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo HTTP/2.0"
like image 148
Dimaf Avatar answered Oct 15 '25 05:10

Dimaf