On Thursday, March 3, 2016 at 3:11:15 PM UTC+11, Angus Ma wrote:
>
> yes, it is possible.
>
> client side:
>
> metadata = [(b'client', b'foo'), (b'version', b'bar')]
> response = stub.YourGRPCMessage(request, _TIMEOUT_SECONDS, 
> metadata=metadata)
>
> server side:
>
> metadata = context.invocation_metadata()
> metadata_dict = {}
> for c in metadata:
>      metadata_dict[c.key] = c.value
>

This seems to have now changed. The metadata now is now simply a list of of 
tuples.

Is there a reason why this was changed?

 
>
> On Thursday, 3 March 2016 07:30:26 UTC+8, Alex Lamaison wrote:
>>
>> How do you set the request metadata in the client and retrieve it in the 
>> server when using Python gRPC?
>>
>> We are looking at ways to pass trace IDs across RPC calls for 
>> Dapper-style tracing. Of course we could add a field to every request 
>> proto, but it seems more appropriate to use metadata to avoid cluttering 
>> the API. Is that possible?
>>
>> Many thanks, Alex
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/d57e4132-2eea-451c-9246-0a1b9e325a23%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to