-
Notifications
You must be signed in to change notification settings - Fork 21
Description
For the purpose of routing at GFE level, there is a need for a part of RPC’s input message to be extracted and put into a header. This is called ‘dynamic routing’ and the header ‘the routing header’. There are 3 teams that currently have a need for this functionality: BigTable, Spanner and Firestore.
Currently there is a support for dynamic routing in client libraries – the code fills the x-goog-request-params header with the string constructed from the values of the fields bound to the URI in the google.api.http annotation. However, several teams want the ability to specify a more specific header. This header will be specified in a new google.api.routing annotation, detailed as such:
// Specification of information to add to facilitate correct routing of the API requests.
message RoutingRule {
repeated HeaderParameter routing_parameters = 1;
}
where HeaderParameter is
// A projection from an input message to the routing header
message HeaderParameter {
// A field to extract the header key-value pair from
string field = 1;
// A pattern matching the key-value field. Optional.
// If not specified, the whole field specified in the `field` field will be taken as value, and its name used as key.
string path_template = 2;
}
The ability to override this annotation will exist in the ${service}.yaml file for each API, and that is where the generator will check for the annotation.
Please ping me for additional internal docs or info if needed.