GRPC C++
1.30.0
|
The service config is a mechanism that allows service owners to publish parameters to be automatically used by all clients of their service.
The format of the service config is defined by the grpc.service_config.ServiceConfig
protocol buffer message. Note that new fields may be added in the future as new functionality is introduced.
A service config is associated with a server name. The nameresolver" plugin, when asked to resolve a particular server name, will return both the resolved addresses and the service config.
The name resolver returns the service config to the gRPC client in JSON form. Individual resolver implementations determine where and in what format the service config is stored. If the resolver implemention obtains the service config in protobuf form, it must convert it to JSON using the normal protobuf to JSON translation rules. Alternatively, a resolver implementation may obtain the service config already in JSON form, in which case it may return it directly.
For details of how the DNS resolver plugin supports service configs, see gRFC A2: Service Config via DNS.
Here is an example service config in protobuf form:
Here is the same example service config in JSON form:
The service config is used in the following APIs: