Hello Ankur, The io.grpc.Context is indeed the right thing to use here. What you want to do is to first create a ServerInterceptor that looks at the incoming headers and pulls out all "l5d-" prefixed keys. The ServerCall.Listener is how your application defines how to respond to incoming requests, so the interceptor must make sure that a io.grpc.Context containing the "l5d-" info is present whenever your code runs. Next, you need a ClientInterceptor that looks at the current io.grpc.Context, and merges "l5d-" headers into any outgoing headers.
I have created a branch on github that shows what I mean: https://github.com/grpc/grpc-java/compare/master...zpencer:grpc-io-l5d-demo?expand=1 On Thu, Jul 27, 2017 at 9:01 PM, Ankur Chauhan <[email protected]> wrote: > Hi, > > I am trying to integrate some of our grpc services with linkerd ( a > service mesh ). As a part of doing that, the recommendation is that the > apps should propagate any headers with "l5d-" prefix to all downstream > services. I tried looking at some tests for io.grpc.Context but can't > figure out what would be the best way to do this. Anyone care to comment? > This should be similar to how deadlines are propagated (i think). > > -- Ankur > > -- > 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/19357e59-34d8-461a-997e-287cac9f096b%40googlegroups.com > <https://groups.google.com/d/msgid/grpc-io/19357e59-34d8-461a-997e-287cac9f096b%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Spencer Fang -- 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/CAK%3D-x_6NeEXCwx3_VJ7D1NRdCC-DAp5czZf9G2TyFq5rKzN62Q%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
