0%

Feign与Hystrix

Feign与Hystrix

Feign默认已经整合了hystrix,只是默认是没有启用的,需要进行配置

1
2
3
feign:
hystrix:
enabled: true

虽然开启了hystrix,但是其默认不带有监控端点,如果想要使用监控端点,需要加依赖

1
2
3
4
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
</dependency>

然后启动类上增加@EnableCircuitBreaker注解,并开启端点

1
2
3
4
5
management:
endpoints:
web:
exposure:
include: 'hystrix.stream'

欢迎关注我的其它发布渠道