Class ChannelIdInjector

  • All Implemented Interfaces:
    io.grpc.ClientInterceptor

    @ThreadSafe
    public final class ChannelIdInjector
    extends java.lang.Object
    implements io.grpc.ClientInterceptor
    Client side interceptor that is used to augment outgoing metadata with the unique id for the channel that the RPC is being called on.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static io.grpc.Metadata.Key<java.util.UUID> S_CLIENT_ID_KEY
      Metadata key for the channel Id.
    • Constructor Summary

      Constructors 
      Constructor Description
      ChannelIdInjector​(java.util.UUID channelId)
      Creates the injector that augments the outgoing metadata with given Id.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <ReqT,​RespT>
      io.grpc.ClientCall<ReqT,​RespT>
      interceptCall​(io.grpc.MethodDescriptor<ReqT,​RespT> method, io.grpc.CallOptions callOptions, io.grpc.Channel next)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • S_CLIENT_ID_KEY

        public static final io.grpc.Metadata.Key<java.util.UUID> S_CLIENT_ID_KEY
        Metadata key for the channel Id.
    • Constructor Detail

      • ChannelIdInjector

        public ChannelIdInjector​(java.util.UUID channelId)
        Creates the injector that augments the outgoing metadata with given Id.
        Parameters:
        channelId - channel id
    • Method Detail

      • interceptCall

        public <ReqT,​RespT> io.grpc.ClientCall<ReqT,​RespT> interceptCall​(io.grpc.MethodDescriptor<ReqT,​RespT> method,
                                                                                     io.grpc.CallOptions callOptions,
                                                                                     io.grpc.Channel next)
        Specified by:
        interceptCall in interface io.grpc.ClientInterceptor