springcloud Finchley基于springboot2.0 开启hystrix dashboard Unable to connect to Command Metric Stream

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/c5113620/article/details/82023681

springcloud Finchley改动很大,很多配置的名称,模块的名称都变了,开启hystrix dashboard页也不一样

springcloud Finchley 模块名称变更查看

pom.xml

<dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>

bootstrap.properties 配置。开启暴露接口

#/actuator/hystrix.stream
management.endpoints.web.exposure.include=*

启动类main注解

@EnableCircuitBreaker
@EnableHystrixDashboard

访问ip:port/contextPath/hystrix
输入ip:port/contextPath/actuator/hystrix.stream 上下都显示loading 就说明连接上了

访问被@HystrixCommand注解的方法,就能看到统计

猜你喜欢

转载自blog.csdn.net/c5113620/article/details/82023681
今日推荐