Annotation Interface GrpcChannel


A qualifier annotation that can be used to specify the name of a configured gRPC channel to inject, or the name of the host to connect to, as described in GrpcChannelsProvider.channel(String) documentation.

For example:

     @Inject
     @GrpcChannel(name = "foo")
     private Channel channel;
 
This annotation can also be specified at the injection point for a client proxy, in combination with the @GrpcProxy annotation:
     @Inject
     @GrpcChannel(name = "foo")
     @GrpcProxy
     private FooServiceClient client;
 
Alternatively, if the client proxy should always use the same channel, it can be specified on the client interface instead:
     @Grpc(name = "FooService")
     @GrpcChannel(name = "foo")
     public interface FooServiceClient {
         ...
     };
 
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    An AnnotationLiteral for the GrpcChannel annotation.
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The name of the configured channel or gRPC server host.
  • Element Details

    • name

      String name
      The name of the configured channel or gRPC server host.
      Returns:
      name of the channel