Hystrix仪表盘:Spring Cloud Hystrix Dashboard

1、开启多个Eureka Client服务实例

2、hystrix-dashboard(单服务):

①、添加依赖:hystrix、hystrix-dashboard和actuator

②、启动类上添加@EnableHystrixDashboard开启Hystrix Dashboard功能(Spring Boot 2.0.0以上版本需要在服务调用者启动项中添加ServletRegistrationBean)

③、配置application.properties文件,配置端口号和服务名

④、服务实例需添加actuator和hystrix依赖

⑤、服务实例的启动类上需使用@EnableCircuitBreaker注解

3、hystrix-dashboard(集群):

①、添加依赖:actuator和turbine

②、启动类上添加@EnableTurbine注解开启Turbine

③、配置application.properties文件,配置Eureka注册中心和Turbine相关配置

4、Hystrix Dashboard与RabbitMQ整合:

①、创建Spring Boot工程,turbine-amqp

②、添加依赖:spring-cloud-starter-turbine-amqp和actuator

③、启动类上添加@EnableTurbineStream注解开启Turbine Stream功能

④、配置application.properties文件

⑤、服务消费者添加spring-cloud-netflix-amqp依赖,然后开启服务

你可能感兴趣的:(Hystrix仪表盘:Spring Cloud Hystrix Dashboard)