Annotation Interface ImportGrpcClients
@Retention(RUNTIME)
@Target(TYPE)
@Documented
@Import(AnnotationGrpcClientRegistrar.class)
@Repeatable(ImportGrpcClients.Container.class)
public @interface ImportGrpcClients
Annotation to create gRPC client beans.
- Author:
- Dave Syer
-
Nested Class Summary
Nested Classes -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionClass<?>[]The base package classes to scan for stub implementations.String[]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 targetThe 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 prefixThe 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
Concrete types of the stubs to create.- Returns:
- the types of the stubs
- Default:
{}
-
value
Concrete types of the stubs to create.- Returns:
- the types of the stubs
- Default:
{}
-
factory
Class<? extends StubFactory<?>> factoryThe 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<?>[] basePackageClassesThe 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 configuredfactory().- Returns:
- the base package classes for scanning
- Default:
{}
-
basePackages
-