通过配置类开启feign的hystrix服务不起作用
Closed this issue · 1 comments
coderqianlq commented
定义配置类设置feign.hystrix.enabled=true不起作用,配置类如下:
@configuration
@ConditionalOnClass({HystrixCommand.class, HystrixFeign.class})
public class FeignServerConfiguration {
@Bean
@Scope("prototype")
@ConditionalOnProperty(name = "feign.hystrix.enabled", matchIfMissing = true)
public Feign.Builder feignBuilder() {
return Feign.builder();
}
}
目前是通过在配置文件中application.properties中添加feign.hystrix.enabled=true开启feign的hystrix服务。
coderqianlq commented
Spring Cloud切换到Finchley或更高版本feign.hystrix.enabled=true配置才生效