Adding metadata to an RPC

31 views
Skip to first unread message

Guy Pardon

unread,
Oct 14, 2020, 3:43:40 AM10/14/20
to Protocol Buffers
Hi,

Being new to protocol buffers and gRPC, I am looking for a good way to add metadata "annotations" to the contract description.

In particular, we are adding transaction context propagation across gRPC calls. We would like to mark some RPCs (or services) as "transactional" - meaning that they expect / support a transaction context header in the incoming request.

What is the recommended way of doing this? I did not seem to find this in the documentation.

Thanks,
Guy

Marc Gravell

unread,
Oct 14, 2020, 3:48:12 AM10/14/20
to Guy Pardon, Protocol Buffers
"custom options" exist, but frankly they don't do much unless you have custom code generation that is going to emit something useful from them, and that "something" itself does something useful at runtime - which may itself be tricky between runtimes/platforms.

Does "add a comment" suffice?

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/fdbe28a3-56de-4958-b138-ca4c2e6fb896n%40googlegroups.com.


--
Regards,

Marc

Guy Pardon

unread,
Oct 14, 2020, 5:51:11 AM10/14/20
to Protocol Buffers
Makes sense, thanks.

Alternatively, there seem to be Java options that we could define? (since we're doing Java)

Guy

Op woensdag 14 oktober 2020 om 09:48:12 UTC+2 schreef marc.g...@gmail.com:
Reply all
Reply to author
Forward
0 new messages