Mark @FeignClient beans as primary.

When fallback beans are created, there was no longer a unique bean of the feign interface which caused autowire problems.

fixes gh-899
This commit is contained in:
Spencer Gibb
2016-03-16 17:01:45 -06:00
parent b9a6876d00
commit 08f7076f6e
3 changed files with 24 additions and 9 deletions

View File

@@ -789,7 +789,7 @@ In the `@FeignClient` annotation the String value ("stores" above) is
an arbitrary client name, which is used to create a Ribbon load
balancer (see <<spring-cloud-ribbon,below for details of Ribbon
support>>). You can also specify a URL using the `url` attribute
(absolute value or just a hostname).
(absolute value or just a hostname). The name of the bean in the application context is the fully qualified name of the interface. An alias is also created which is the 'name' attribute plus 'FeignClient'. For the example above, `@Qualifier("storesFeignClient")` could be used to reference the bean.
The Ribbon client above will want to discover the physical addresses
for the "stores" service. If your application is a Eureka client then