Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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);
    }
}
like image 267
jaks Avatar asked Nov 06 '16 09:11

jaks


People also ask

How do I enable hystrix in spring boot?

First, we need to add the Spring Cloud Starter Hystrix dependency in our build configuration file. Now, add the @EnableHystrix annotation into your main Spring Boot application class file. The @EnableHystrix annotation is used to enable the Hystrix functionalities into your Spring Boot application.

Is hystrix still supported?

In SpringOne 2019, Spring announced that Hystrix Dashboard will be removed from Spring Cloud 3.1 version which makes it officially dead. As the Circuit Breaker pattern has been advertised so heavily, many developers have either used it or want to use it, and now need a replacement.


1 Answers

For those who are using spring boot 2 (I am using 2.0.2.RELEASE), the hystrix.stream endpoint has been moved to /actuator/hystrix.stream.

For me this url worked:

http://localhost:8082/actuator/hystrix.stream

And yes, have this actuator endpoint enabled via following property:

management.endpoints.web.exposure.include=hystrix.stream
like image 97
Shanu Gupta Avatar answered Sep 30 '22 09:09

Shanu Gupta