Search code examples
spring-cloudhystrixspring-cloud-netflix

Unable to get /hystrix.stream in Spring Cloud


I have created a microservice with following dependencies of Spring cloud version Camden.SR2. Spring Boot 1.4.1. http://localhost:8080/hystrix.stream is not responding.

If I make the Spring Cloud version as Brixton.*(RELEASE, SR1,...), I get only ping: as reply in browser.

<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

Application

@SpringBootApplication
@EnableCircuitBreaker
public class SampleApplication {

    public static void main(String[] args) {
        SpringApplication.run(SampleApplication.class, args);
    }
}

Solution

  • In Spring Boot 1.5.x Hystrix.stream will only show data if there are actually call's being executed that are annotated with @HystrixCommand

    If you annotate a method it will publish data to the stream when its being used.

    More info: http://cloud.spring.io/spring-cloud-static/Brixton.SR6/#_circuit_breaker_hystrix_clients