Special thanks to:
Spencer Fang - https://groups.google.com/forum/#!topic/grpc-io/Eke0FzdY9go
In order to correctly forward headers from linkerd proxy. Add the L5dServerInterceptor
instance to the using the
ServerInterceptors
utility class. For example:
...
GrpcServiceImpl serviceImpl = ...
ServerInterceptors.intercept(serviceImpl, new L5dServerInterceptor());
...
Similarly, while creating a new client add the L5dClientInterceptor
instance to the channel using the
ClientInterceptors
utility class. For example:
...
GrpcService.newBlockingStub(ClientInterceptors.intercept(nettyChannel, new L5dClientInterceptor()));
...