【发布时间】:2019-02-03 23:39:57
【问题描述】:
与this post 类似,我创建了另一个基于涡轮流的应用程序来收集来自其他应用程序的 hystrix 流。
Spring Boot:2.0.4.RELEASE,Spring Cloud:Finchley.SR1
应用类:
@SpringBootApplication
@EnableDiscoveryClient
@EnableTurbineStream
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}
maven 依赖:
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-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-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
应用程序配置文件是:
server:
port: 8989
spring:
application:
name: hystrix-turbine-stream
management:
endpoints:
web.exposure.include: '*'
当我浏览 @EanbleTurbineStream 的源代码时,发现 TurbineController 将 Flux 暴露给根 '/' 端点。
但是当我尝试在 Hystrix Dashboard 中探索 http://localhost:8989 时,发现它没有按预期工作。
更新:当我尝试访问涡轮流应用程序时,得到:
curl http://localhost:8989
data:{"type":"ping"}
data:{"type":"ping"}
data:{"type":"ping"}
data:{"type":"ping"}
在应用程序控制台(日志记录)中,有一些日志显示为:
: Registering MessageChannel turbineStreamInput
但我在client app 中看不到有一些消息发送到此频道。
这里是sample codes of my turbine stream application
Update2:成功了,我使用了一个过时的 spring-cloud-starter-netflix-hystrix-stream(在 v2.0.0M2 中存在,但不是存在于最终版本中)在我的客户端应用程序中,当我使用 spring-cloud-starter-netflix-hystrix 和 spring-cloud-netflix-hystrix-stream 组合客户端应用,运行良好。
【问题讨论】:
标签: spring spring-cloud spring-cloud-stream spring-cloud-netflix