【问题标题】:Spring Cloud turbine - No data returned from /turbine.streamSpring Cloud 涡轮机 - 没有从 /turbine.stream 返回的数据
【发布时间】:2017-07-11 19:29:58
【问题描述】:

我的技术栈包括以下内容

  • Eureka 发现服务器
  • 祖尔网关
  • Spring 配置服务器
  • Hystrix 仪表板
  • 我的核心服务启用了 Hystrix 流。

Hystrix 仪表板工作正常,因为我可以使用暴露在我的服务之外的 hystrics.stream 进行流式传输。

但是,每当我尝试将涡轮机添加到此堆栈时,/turbine.stream 只会在浏览器上重复返回 data: {"type":"Ping"},因此 Hystrix 仪表板显示 Unable to connect to Command Metric Stream

有人可以帮我找出我哪里出错了吗?

这是我的涡轮机关键配置。 TurbineAppliation 类只是一个带有 @EnableTurbineStream 的 springboot 应用程序,因此不在下面列出。

pom 依赖:

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.5.1.RELEASE</version>
</parent>

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-dependencies</artifactId>
            <version>Camden.SR5</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

<dependencies>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-config-client</artifactId>
    </dependency>

    <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>

</dependencies>

bootstrap.yml:(请忽略 eureka 特定的配置,如果我自己没有调整它们无关紧要)。配置服务器和 eureka 设置对于所有其他运行良好的组件都是相同的。

spring:
  application:
    name: Turbine
  cloud:
    config:
      enabled: true
      discovery:
        enabled: true
        serviceId: ConfigServer

management:
  security:
    enabled: false

eureka:
  instance:
    leaseRenewalIntervalInSeconds: 10
#    leaseExpirationDurationInSeconds: 2
    preferIpAddress: true
    ipAddress: 127.0.0.1
  client:
    serviceUrl:
      defaultZone: http://localhost:8761/discovery/eureka/ ---discovery is my eureka context root required for my app

application.yml

server:
  port: 7980

info:
  component: Turbine App

turbine:
  aggregator:
    clusterConfig: MY-SERVICE
  appConfig: MY-SERVICE
  clusterNameExpression: new String('default')
  InstanceMonitor:
    eventStream:
      skipLineLogic:
        enabled: false

【问题讨论】:

  • 你有从rabbit mq读取的涡轮流,你有hystrix流(即到rabbit)还是​​只有HTTP?
  • 是的,我的 hysterix 流也在使用 rabbit,它工作得很好
  • @spencergibb - 你对出了什么问题有任何想法吗?
  • github.com/spring-cloud/spring-cloud-stream/issues/810 下周将会有一个带有修复的 Camden.SR6。
  • 好的,等待修复

标签: spring-boot spring-cloud turbine


【解决方案1】:

您好,我正在使用 Camden.SR6 处理同样的问题。

在 Turbine Service pom.xml 中添加以下内容后,我能够在 hystrix 仪表板中使用涡轮流:

    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-netflix-hystrix-amqp</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-bus-amqp</artifactId>
    </dependency>

我还在 bootstrap.properties 文件中添加了:spring.rabbitmq.address=rabbit-mq-server:5672。

【讨论】:

    【解决方案2】:

    在 Spring Cloud Camden SR5 的新版本中,rabbitMQ 队列从 springCloudHystrixStream 重命名为 turbineStreamInput。 作为一种解决方法,您可以指定以前版本的 spring-cloud-stream

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-stream</artifactId>
            <version>1.1.0.RELEASE</version>
        </dependency>
    

    【讨论】:

    • 我当然可以尝试,但是在我使用的这个新版本中涡轮流如何工作?
    • 我不知道细节,这是一个错误。我注意到的问题是涡轮正在监听涡轮流输入,但 hystrix 正在发送到 springCloudHystrixStream。
    • 谢谢,我们会尝试并在我有时间的时候更新。我转向其他事情,因为我无法获得更多信息。
    【解决方案3】:

    在你的 pom 中用于 turbine 应用程序

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-netflix</artifactId>
                <version>1.3.0.M1</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
    

    【讨论】:

      猜你喜欢
      • 2019-01-07
      • 2019-03-26
      • 2015-10-22
      • 1970-01-01
      • 2011-03-22
      • 2011-01-25
      • 2018-05-19
      • 2018-05-29
      • 2019-01-31
      相关资源
      最近更新 更多