Feign 的动态 URL
2024-09-30 08:00:49
# Technical
# Notes
继承 Feign.Builder,重写 target 方法
1 |
|
从配置中心,获取动态的URL
1 |
|
注意
可能会出现 BeanCreationException
异常:
1 | Unsatisfied dependency expressed through constructor parammeter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creeating bean with name '......': FactoryBean threw exception object creation; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'feign.Feign$Builder' available: expected single matching bean but found 2: feignBuilderHelper,feignHystrixBuilder |
解决:
FeignBuilderHelper
添加 @Primary
注解