使用:
首先是最基本的熔断hystrix依赖:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
</dependency>
下面是可视化的依赖:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
确保这三个依赖加上之后:
启动类加上:@EnableHystrixDashboard
登录:
http://localhost:8080/hystrix
配置完了之后进入:
会出现:
爬坑:
关于boot版本 2.0以后版本需要配置下这个:
management.endpoints.web.exposure.include=hystrix.stream
但我这里直接全部开放
management.endpoints.web.exposure.include=*
第二点:
进入的时候不要用它的https
把https改为http即可访问:
http://localhost:端口号/actuator/hystrix.stream