@Target(value={FIELD,METHOD})
@Retention(value=RUNTIME)
@Documented
@Inherited
public @interface GrpcClient
Channel or subclasses of AbstractStub/gRPC client services. Also
works for annotated methods that only take a single parameter of the same types. Annotated fields/methods will be
automatically populated/invoked by Spring.
Note: Fields/Methods that are annotated with this annotation should NOT be annotated with Autowired or
Inject (conflict).
Note: If you annotate an AbstractStub with this annotation the bean processing will also apply the
StubTransformers in the application context. These can be used, for example, to configure CallOptions
such as CallCredentials. Please note that these transformations aren't applied if you inject a
Channel only.
| Modifier and Type | Required Element and Description |
|---|---|
java.lang.String |
value
The name of the grpc client.
|
| Modifier and Type | Optional Element and Description |
|---|---|
java.lang.String[] |
interceptorNames
A list of
ClientInterceptor beans that should be used with this client in addition to the globally
defined ones. |
java.lang.Class<? extends io.grpc.ClientInterceptor>[] |
interceptors
A list of
ClientInterceptor classes that should be used with this client in addition to the globally
defined ones. |
public abstract java.lang.String value
config options for
this client.
Example: @GrpcClient("myClient") <-> grpc.client.myClient.port=9090
Note: This value might also be used to check the common / alternative names in server certificate, you can
overwrite this value with the security.authorityOverride property.
public abstract java.lang.Class<? extends io.grpc.ClientInterceptor>[] interceptors
ClientInterceptor classes that should be used with this client in addition to the globally
defined ones. If a bean of the given type exists, it will be used; otherwise a new instance of that class will be
created via no-args constructor.
Note: These interceptors will be applied after the global interceptors. But the interceptors that were applied last, will be called first.
public abstract java.lang.String[] interceptorNames
ClientInterceptor beans that should be used with this client in addition to the globally
defined ones.
Note: These interceptors will be applied after the global interceptors and the interceptor classes. But the interceptors that were applied last, will be called first.