Annotation Type EnableFeignClients
@Retention(RUNTIME)
@Target(TYPE)
@Documented
@Import(org.springframework.cloud.openfeign.FeignClientsRegistrar.class)
public @interface EnableFeignClients
Scans for interfaces that declare they are feign clients (via
FeignClient @FeignClient).
Configures component scanning directives for use with
Configuration
@Configuration classes.- Since:
- 1.0
- Author:
- Spencer Gibb, Dave Syer
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionClass<?>[]Type-safe alternative tobasePackages()for specifying the packages to scan for annotated components.String[]Base packages to scan for annotated components.Class<?>[]List of classes annotated with @FeignClient.Class<?>[]A custom@Configurationfor all feign clients.String[]Alias for thebasePackages()attribute.
-
Element Details
-
value
String[] valueAlias for thebasePackages()attribute. Allows for more concise annotation declarations e.g.:@ComponentScan("org.my.pkg")instead of@ComponentScan(basePackages="org.my.pkg").- Returns:
- the array of 'basePackages'.
- Default:
- {}
-
basePackages
String[] basePackagesBase packages to scan for annotated components.value()is an alias for (and mutually exclusive with) this attribute.Use
basePackageClasses()for a type-safe alternative to String-based package names.- Returns:
- the array of 'basePackages'.
- Default:
- {}
-
basePackageClasses
Class<?>[] basePackageClassesType-safe alternative tobasePackages()for specifying the packages to scan for annotated components. The package of each class specified will be scanned.Consider creating a special no-op marker class or interface in each package that serves no purpose other than being referenced by this attribute.
- Returns:
- the array of 'basePackageClasses'.
- Default:
- {}
-
defaultConfiguration
Class<?>[] defaultConfigurationA custom@Configurationfor all feign clients. Can contain override@Beandefinition for the pieces that make up the client, for instanceDecoder,Encoder,Contract.- Returns:
- list of default configurations
- See Also:
- Default:
- {}
-
clients
Class<?>[] clientsList of classes annotated with @FeignClient. If not empty, disables classpath scanning.- Returns:
- list of FeignClient classes
- Default:
- {}
-