Annotation Interface ImportGrpcClients


Annotation to create gRPC client beans.
Author:
Dave Syer
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static @interface 
     
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Class<?>[]
    The base package classes to scan for stub implementations.
    The base packages to scan for stub implementations.
    Class<? extends StubFactory<?>>
    The factory type to use to create the stubs.
    The prefix to use when creating bean definitions for clients, completed by the simple name of the class.
    The name or base URL of the gRPC server to connect to.
    Class<?>[]
    Concrete types of the stubs to create.
    Class<?>[]
    Concrete types of the stubs to create.
  • Element Details

    • target

      String target
      The name or base URL of the gRPC server to connect to. If not specified, the client will connect to the default server.
      Returns:
      the name or base URL of the server
      Default:
      "default"
    • prefix

      String prefix
      The prefix to use when creating bean definitions for clients, completed by the simple name of the class. Default is empty. You only need to specify a value if you define more than one client of the same type (or with types that have the same name in different packages).
      Returns:
      the prefix
      Default:
      ""
    • types

      @AliasFor("value") Class<?>[] types
      Concrete types of the stubs to create.
      Returns:
      the types of the stubs
      Default:
      {}
    • value

      @AliasFor("types") Class<?>[] value
      Concrete types of the stubs to create.
      Returns:
      the types of the stubs
      Default:
      {}
    • factory

      Class<? extends StubFactory<?>> factory
      The factory type to use to create the stubs. Only needed if you are scanning (with basePackageClasses or basePackages) and you need to customize the stub creation.
      Returns:
      the factory type, default is BlockingStubFactory
      Default:
      org.springframework.grpc.client.UnspecifiedStubFactory.class
    • basePackageClasses

      Class<?>[] basePackageClasses
      The base package classes to scan for stub implementations. If not specified, scanning will be done from the package of the class with this annotation. When a stub is found, a client bean will be created for it using the configured factory().
      Returns:
      the base package classes for scanning
      Default:
      {}
    • basePackages

      String[] basePackages
      The base packages to scan for stub implementations. When a stub is found, a client bean will be created for it using the configured factory().
      Returns:
      the base packages for scanning
      Default:
      {}