🔌 gRPC Intermediate

What is gRPC reflection?

Answer

gRPC reflection is a service that allows clients to discover the services and methods available on a gRPC server at runtime, without access to the .proto files at development time. This is analogous to Swagger/OpenAPI exploration for REST. The server registers the reflection service: reflection.Register(grpcServer). Clients like grpcurl use reflection to list services (grpcurl -plaintext localhost:50051 list), describe services (grpcurl ... describe MyService), and call methods (grpcurl ... -d '{"id":1}' MyService/GetUser). The Postman gRPC client and BloomRPC GUI tools also use reflection for schema discovery. In production, you may want to disable reflection to avoid exposing your API surface, or restrict it to development environments.