我创建了一个具有以下 Spring Cloud 版本依赖项的微服务 Camden.SR2
. Spring 启动 1.4.1。 http://localhost:8080/hystrix.stream
没有响应。
如果我将 Spring Cloud 版本设为 Brixton.*
(RELEASE, SR1,...), 我只得到 ping:
作为浏览器中的回复。
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-hystrix</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-rest</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
应用程序属性
spring.application.name=sample-service
server.port = 8080
应用
@SpringBootApplication
@EnableCircuitBreaker
public class SampleApplication {
public static void main(String[] args) {
SpringApplication.run(SampleApplication.class, args);
}
}
最佳答案
对于使用 spring boot 2 的用户(我使用的是 2.0.2.RELEASE)
, hystrix.stream
端点已移至 /actuator/hystrix.stream
。
对我来说,这个网址有效:
http://localhost:8082/actuator/hystrix.stream
是的,通过以下属性启用此执行器端点:
management.endpoints.web.exposure.include=hystrix.stream
关于spring-cloud - 无法在 Spring Cloud 中获取/hystrix.stream,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40447916/