Annotation Interface GrpcService


@Target({TYPE,METHOD}) @Retention(RUNTIME) @Documented @Service @Bean public @interface GrpcService
Annotation that marks gRPC services that should be registered with a gRPC server.

NOTE: This annotation is optional as all BindableService beans will be registered with a gRPC server. However, this annotation allows specifying additional information about the service (e.g. interceptors).

NOTE: This annotation should only be added to BindableService beans.

Author:
Michael ([email protected]), Chris Bono
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Whether the service specific interceptors should be blended with the global interceptors.
    The ServerInterceptor bean names to be applied to the service.
    Class<? extends io.grpc.ServerInterceptor>[]
    The ServerInterceptor bean types to be applied to the service.
  • Element Details

    • interceptors

      Class<? extends io.grpc.ServerInterceptor>[] interceptors
      The ServerInterceptor bean types to be applied to the service.
      Returns:
      the interceptor bean types to be applied to the service
      Default:
      {}
    • interceptorNames

      String[] interceptorNames
      The ServerInterceptor bean names to be applied to the service.
      Returns:
      the interceptor bean names to be applied to the service
      Default:
      {}
    • blendWithGlobalInterceptors

      boolean blendWithGlobalInterceptors
      Whether the service specific interceptors should be blended with the global interceptors.

      When false, the global interceptors are applied first, followed by the service specific interceptors.

      When true, the global interceptors are merged and sorted (blended) with the service specific interceptors.

      Returns:
      whether the service specific interceptors should be blended with the global interceptors
      Default:
      false