spring-cloud-hystrix之Unable to connect to Command Metric Stream.异常 - Go语言中文社区

spring-cloud-hystrix之Unable to connect to Command Metric Stream.异常


解决方法:

1,检查是否添加以下依赖

<!--监控中心-->
<dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>

<!-- hystrix 断路器-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-hystrix</artifactId>
</dependency>

<!-- hystrix-dashboard监控 -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-hystrix-dashboard</artifactId>
</dependency>

2,springboot启动程序是否设置@EnableHystrixDashboard、@EnableCircuitBreaker注解

      @EnableFeignClients
      @EnableDiscoveryClient
      @SpringBootApplication
      @EnableHystrixDashboard
      @EnableCircuitBreaker
      public class FeignApplication {
            public static void main(String[] args) {
               SpringApplication.run(FeignApplication.class, args);
             }
       }

3,是否在服务方法上添加  @HystrixCommand配置

         @HystrixCommand(fallbackMethod = "addFallBack",
    threadPoolProperties = {
            @HystrixProperty(name = "coreSize", value = "30"),
            @HystrixProperty(name = "maxQueueSize", value = "101"),
            @HystrixProperty(name = "keepAliveTimeMinutes", value = "2"),
            @HystrixProperty(name = "queueSizeRejectionThreshold", value = "15"),
            @HystrixProperty(name = "metrics.rollingStats.numBuckets", value = "12"),
            @HystrixProperty(name = "metrics.rollingStats.timeInMilliseconds", value = "1440")
            },
       commandProperties = {
            @HystrixProperty(name="execution.isolation.strategy", value="SEMAPHORE"),
            @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "100"),  
            @HystrixProperty(name = "circuitBreaker.requestVolumeThreshold", value = "50")
    })  

4,hystrix dashboard主页是否正确设置Monitor Stream

一般为:域名:端口/hystrix.stream    


版权声明:本文来源CSDN,感谢博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://blog.csdn.net/qq_19983129/article/details/72401373
站方申明:本站部分内容来自社区用户分享,若涉及侵权,请联系站方删除。
  • 发表于 2020-03-08 11:35:15
  • 阅读 ( 798 )
  • 分类:

0 条评论

请先 登录 后评论

官方社群

GO教程

猜你喜欢