Spring Cloud Zuul CircuitBreaker 所有路由都通过 TurbineStream 而不是 Turbine-AMQP
Spring Cloud Zuul CircuitBreaker All Routes via TurbineStream Not Turbine-AMQP
我正在使用 spring boot 1.3.1 和 spring cloudl Brixtom.M4,在使用 springboot 1.3.1 时我发现 Turbine-AMQP 项目不再可用,而不是我们现在有 Spring 涡轮流项目。
我用 rabbitmq 或 kafka 用户 SpringTurbine 并希望监视在 Zuul 中注册的所有路由的 hystrix 流,我能够看到 zuul 的 hystrix.stream 并且也能够在 hystrix 中看到它仪表板,但不确定如何使用 spring 涡轮流。
在网上我找到了使用 Turbine AMQP 的代码和文档。
我有 zuul 服务器 运行宁广告 http://localhost:9003/ 与 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>
和main.java作为
@SpringBootApplication
@EnableZuulProxy
@EnableCircuitBreaker
public class EdgeServerApplication {
public static void main(String[] args) {
SpringApplication.run(EdgeServerApplication.class, args);
}
}
我还有 springTurbinestream 项目
<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
和 TurbineStream 的主要 class as
@SpringBootApplication
@EnableTurbineStream
@EnableDiscoveryClient
public class WiziqTurbineApplication {
public static void main(String[] args) {
SpringApplication.run(WiziqTurbineApplication.class, args);
}
}
当我 运行 应用程序并转到 http://localhost:9003/hystrix.stream i see the stream but if i go to http://localhost:9003/turbine.stream 它会出错。
我做错了什么?
您的客户端应用程序(在端口 9003 上)不应该有 /turbine.stream
。它应该将带有 hystrix 指标的消息发送给 rabbit(例如)。为此,您需要添加 spring-cloud-netflix-hystrix-stream
和 spring-cloud-starter-stream-rabbit
(就像您在服务器上为 *-turbine-*
依赖项所做的那样)。
我正在使用 spring boot 1.3.1 和 spring cloudl Brixtom.M4,在使用 springboot 1.3.1 时我发现 Turbine-AMQP 项目不再可用,而不是我们现在有 Spring 涡轮流项目。 我用 rabbitmq 或 kafka 用户 SpringTurbine 并希望监视在 Zuul 中注册的所有路由的 hystrix 流,我能够看到 zuul 的 hystrix.stream 并且也能够在 hystrix 中看到它仪表板,但不确定如何使用 spring 涡轮流。 在网上我找到了使用 Turbine AMQP 的代码和文档。
我有 zuul 服务器 运行宁广告 http://localhost:9003/ 与 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>
和main.java作为
@SpringBootApplication
@EnableZuulProxy
@EnableCircuitBreaker
public class EdgeServerApplication {
public static void main(String[] args) {
SpringApplication.run(EdgeServerApplication.class, args);
}
}
我还有 springTurbinestream 项目
<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
和 TurbineStream 的主要 class as
@SpringBootApplication
@EnableTurbineStream
@EnableDiscoveryClient
public class WiziqTurbineApplication {
public static void main(String[] args) {
SpringApplication.run(WiziqTurbineApplication.class, args);
}
}
当我 运行 应用程序并转到 http://localhost:9003/hystrix.stream i see the stream but if i go to http://localhost:9003/turbine.stream 它会出错。
我做错了什么?
您的客户端应用程序(在端口 9003 上)不应该有 /turbine.stream
。它应该将带有 hystrix 指标的消息发送给 rabbit(例如)。为此,您需要添加 spring-cloud-netflix-hystrix-stream
和 spring-cloud-starter-stream-rabbit
(就像您在服务器上为 *-turbine-*
依赖项所做的那样)。