distributedsystem/microservice/grpc
Reflection allows clients to dynamically discover and interact with gRPC services without needing precompiled .proto files.
This is particularly use for CLI tools line grpcurl and postman as well as dynamic clients.
How reflection works Internally
gRPC reflection is implemented as a special service called grpc.reflection.v1alpha.ServerReflection.
When enabled, the server registers metadata that clients can query.
Steps:
- A client sends a reflection request to
grpc.reflection.v1alpha.ServerReflection/grpc.reflection.v1.ServerReflection. - The server responds with a list of available services, methods, and message types.
- The client uses this metadata to construct and send requests dynamically.
