1.首先检查pom.xml
查看项目的版本是否一致,hystrix以及actuator两个依赖是否添加
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot</artifactId>
<version>2.3.7.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>RELEASE</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-netflix-hystrix -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-actuator -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
2.查看resources配置文件
management:
endpoints:
web:
exposure:
include: hystrix.stream
3.hystrix启动类三个注解
@EnableCircuitBreaker
@EnableEurekaClient
@SpringBootApplication
本文介绍了如何排查并解决在使用Spring Cloud Hystrix时,访问actuator/hystrix.stream报错的问题。首先检查POM.xml文件中Hystrix和Actuator的依赖版本是否正确且已添加;其次,检查资源配置文件;最后,确认Hystrix启动类上的三个关键注解是否齐全。
849

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



