【问题标题】:Hystrix: Unable to connect to Command Metric StreamHystrix:无法连接到命令度量流
【发布时间】:2017-05-09 02:22:20
【问题描述】:

我正在使用Spring Boot Admin Application,但在安装Hystrix UI Module 时遇到问题。我按照前面链接中的安装说明进行操作!

在这里你可以看到我的pom.xml 文件:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>poc.spring</groupId>
    <artifactId>wdp-spring-boot-admin</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>wdp-spring-boot-admin</name>
    <description>Spring Boot Admin Application</description>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.4.2.RELEASE</version>
        <relativePath /> <!-- lookup parent from repository -->
    </parent>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
    </properties>

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

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

        <dependency>
            <groupId>de.codecentric</groupId>
            <artifactId>spring-boot-admin-server</artifactId>
            <version>1.4.4</version>
        </dependency>
        <dependency>
            <groupId>de.codecentric</groupId>
            <artifactId>spring-boot-admin-server-ui</artifactId>
            <version>1.4.4</version>
        </dependency>
        <dependency>
            <groupId>de.codecentric</groupId>
            <artifactId>spring-boot-admin-server-ui-hystrix</artifactId>
            <version>1.4.4</version>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>


</project>

这里是我的application.properties 文件:

server.port=8888
spring.boot.admin.routes.endpoints=env,metrics,trace,dump,jolokia,info,configprops,trace,logfile,refresh,flyway,liquibase,heapdump,hystrix.stream

当我尝试打开 Hystrix UI 时,我收到以下错误消息:

http://localhost:8888/#/applications/e6400bbe/hystrix

提前致谢

【问题讨论】:

    标签: spring spring-boot hystrix


    【解决方案1】:

    将以下行添加到您的 application.yml 文件中:

    management:
      security:
        enabled: false 
      endpoints:
        web:
          exposure:
            include: hystrix.stream
          base-path: /
    

    然后触发您的 REST 端点几次并检查 hystrix.stream

    【讨论】:

      【解决方案2】:

      你需要在你的 pom.xml 中添加这个

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

      【讨论】:

        猜你喜欢
        • 2018-12-13
        • 2020-11-06
        • 2015-03-16
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-07-03
        • 2018-09-22
        • 2018-04-12
        相关资源
        最近更新 更多