5 ms·
I am blown away that this is not already part of gRPC. A lifetime ago, I worked on twitter's version of this sort of thing (thrift/finagle) and I assumed it was
by nepthar 3y ago
I am blown away that this is not already part of gRPC. A lifetime ago, I worked on twitter's version of this sort of thing (thrift/finagle) and I assumed it was standard.
- jrockway 3y agoIt's HTTP/2, so has headers and trailers. That's where most people put the metadata.
- no_circuit 3y agoBoth the context and message metadata are already part of gRPC. The gRPC system also allows for server [2] and client message interceptors. Essentially this konig-kontext library provides a interceptor implementations, e.g., [3], that uses their hard-coded key for your serializable context that gets read/written from a gRPC header. The context provided by konig-kontext within your code is a wrapper around the existing gRPC Context [1]. The library is convenient for sure, but I feel that if you had a need to propagate context within gRPC, you'd probably already discovered the API and implemented propagation with your own header keys. [1] https://grpc.github.io/grpc-java/javadoc/io/grpc/Context.html https://grpc.github.io/grpc-java/javadoc/io/grpc/Context.htm... [2] https://grpc.github.io/grpc-java/javadoc/io/grpc/ServerInterceptor.html https://grpc.github.io/grpc-java/javadoc/io/grpc/ServerInter... [3] https://github.com/konigsoftware/konig-kontext/blob/84faa627f43445c7a3e0cad8b96f1fb768eac0ad/lib/src/main/kotlin/com/konigsoftware/kontext/KonigKontextClientInterceptor.kt https://github.com/konigsoftware/konig-kontext/blob/84faa627...