无法在Spring云中获取/hystrix.stream
问题描述:
我创建了一个微服务,其中包含Spring云版本Camden.SR2
的以下依赖项。 Spring Boot 1.4.1。 http://localhost:8080/hystrix.stream
没有回应。无法在Spring云中获取/hystrix.stream
如果我将Spring云版本设为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>
application.properties
spring.application.name=sample-service
server.port = 8080
应用
@SpringBootApplication
@EnableCircuitBreaker
public class SampleApplication {
public static void main(String[] args) {
SpringApplication.run(SampleApplication.class, args);
}
}
答
Hystrix.stream
将只显示的数据,如果有实际调用执行与@HystrixCommand
被注释如果注释是一个方法它会将数据发布到str当它被使用时。
更多信息:http://cloud.spring.io/spring-cloud-static/Brixton.SR6/#_circuit_breaker_hystrix_clients
谢谢。放一个@HystrixCommand并开始工作 – jaks