1.添加依赖
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-hystrix</artifactId> </dependency> <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>
2.添加注解 com.heimeiqiu.HmqDemoServerApplication
@EnableHystrixDashboard//开启hystrix 监控
3.修改服务名称和端口
#端口 server.port=9002 #配置服务名称 spring.application.name=hmq-hystrix-server
4.访问
http://localhost:9002/hystrix