Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

通过配置类开启feign的hystrix服务不起作用 #4

Closed
coderqianlq opened this issue Oct 16, 2018 · 1 comment
Closed

通过配置类开启feign的hystrix服务不起作用 #4

coderqianlq opened this issue Oct 16, 2018 · 1 comment

Comments

@coderqianlq
Copy link
Owner

coderqianlq commented Oct 16, 2018

定义配置类设置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
Copy link
Owner Author

Spring Cloud切换到Finchley或更高版本feign.hystrix.enabled=true配置才生效

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant