Spring Cloud 组件:Hystrix、Ribbon 和 Eureka 实战
1. Hystrix 重构设计与实现
在重构设计中,所有 Feign 客户端交互已从控制器转移到组件类。现在, Product Server Component 依赖于两个代理,这些代理将在运行时注入 Feign 客户端代理。
1.1 启用 Hystrix 仪表盘
要启用 Hystrix 仪表盘,需完成以下步骤:
1. 在 pom.xml 中添加依赖:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-hystrix-dashboard</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
- 在配置类上使用
@EnableHystrixDashboard注解启用第一个依赖,并通过该注解自动启用 Web
超级会员免费看
订阅专栏 解锁全文
168万+

被折叠的 条评论
为什么被折叠?



