There are two python gRPC services A and B.
Service A needs to call a rpc on service B in order to send a response to the client.
Service A also has an interceptor that adds information to gRPC contexts it uses.
Question:
How can I pass the gRPC context to service B so I can access those information on gRPC contexts in service B?
Since you are changing the python object itself, it is not currently possible to pass it in the gRPC call. although you can do this manually by setting your metadata using send_initial_metadata method of your context and writing a new interceptor in service B to parse this information stored in invocation_metadata and setting it in the context of your second service.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With