jak*_*aks 5 hystrix spring-cloud spring-cloud-netflix
我创建了一个具有以下Spring云版本依赖关系的微服务Camden.SR2.Spring Boot 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>
Run Code Online (Sandbox Code Playgroud)
application.properties
spring.application.name=sample-service
server.port = 8080
Run Code Online (Sandbox Code Playgroud)
应用
@SpringBootApplication
@EnableCircuitBreaker
public class SampleApplication {
public static void main(String[] args) {
SpringApplication.run(SampleApplication.class, args);
}
}
Run Code Online (Sandbox Code Playgroud)
Sha*_*pta 12
对于那些使用spring boot 2的人(我正在使用2.0.2.RELEASE),hystrix.stream端点已被移动到/actuator/hystrix.stream.
对我来说,这个网址有效:
http://localhost:8082/actuator/hystrix.stream
Run Code Online (Sandbox Code Playgroud)
是的,通过以下属性启用此执行器端点:
management.endpoints.web.exposure.include=hystrix.stream
Run Code Online (Sandbox Code Playgroud)
Hystrix.stream 只有在实际正在执行的被执行注释的调用时才会显示数据 @HystrixCommand
如果您注释方法,它将在使用时将数据发布到流.
更多信息:http://cloud.spring.io/spring-cloud-static/Brixton.SR6/#_circuit_breaker_hystrix_clients
| 归档时间: |
|
| 查看次数: |
6239 次 |
| 最近记录: |