Search code examples
javaspringspring-bootspring-cloudturbine

Spring Cloud Zuul CircuitBreaker All Routes via TurbineStream Not Turbine-AMQP


I'm using spring boot 1.3.1 and spring cloudl Brixtom.M4, While using springboot 1.3.1 i found that Turbine-AMQP project is no longer available instead we have now Spring Turbine Stream project. I what to user SpringTurbine with rabbitmq or kafka and want to monitor hystrix stream of all routes registered in Zuul, I'm able to see the hystrix.stream for the zuul and also able to see that in hystrix dashboard, but not sure how to use the spring turbine stream. On the net i found the code and documentation for using Turbine AMQP.

I have zuul server running ad http://localhost:9003/ with depedencies

 <dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-eureka</artifactId>
</dependency>
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-zuul</artifactId>
</dependency>
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

and main.java as

@SpringBootApplication
@EnableZuulProxy
@EnableCircuitBreaker
public class EdgeServerApplication {

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

I also have springTurbinestream project as

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-turbine-stream</artifactId>
</dependency>
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-stream-rabbit</artifactId>
</dependency>
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
</dependency>

org.springframework.boot spring-boot-starter-actuator

and main class for TurbineStream as

@SpringBootApplication
@EnableTurbineStream
@EnableDiscoveryClient
public class WiziqTurbineApplication {

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

When I run the application and go to http://localhost:9003/hystrix.stream i see the stream but if i go to http://localhost:9003/turbine.stream it going on error.

What I'm doing wrong?


Solution

  • Your client app (on port 9003) is not supposed to have a /turbine.stream. It is supposed to send messages with hystrix metrics to rabbit (for instance). To make it do that you need to add spring-cloud-netflix-hystrix-stream and spring-cloud-starter-stream-rabbit (just like you did on the server for the *-turbine-* dependencies).