Skip to content

ankurcha/linkerd-grpc-interceptors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

linkerd-grpc-interceptors

Download

Special thanks to:

Spencer Fang - https://groups.google.com/forum/#!topic/grpc-io/Eke0FzdY9go

Usage

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()));
...

Links