SpringCloud (Finchley.SR2)整合hystrix dashboard 提示Unable to connect to Command Metric Stream.

SpringCloud(Finchley.SR2)整合hystrix dashboard 提示Unable to connect to Command Metric Stream.

springcloud(Finchley.SR2)需要使用下面地址

http://localhost:9721/actuator/hystrix.stream

 而不是http://localhost:9721/hystrix.stream

 

 

 

SpringCloud (Finchley.SR2)整合hystrix dashboard 提示Unable to connect to Command Metric Stream._第1张图片

 

 

 搜了很多解决方案,突然看到这个博客https://blog.csdn.net/ddxd0406/article/details/79643059

将下面的代码配置加到配置中

  @Bean
    public ServletRegistrationBean getServlet(){
        HystrixMetricsStreamServlet streamServlet = new HystrixMetricsStreamServlet();
        ServletRegistrationBean registrationBean = new ServletRegistrationBean(streamServlet);
        registrationBean.setLoadOnStartup(1);
        registrationBean.addUrlMappings("/actuator/hystrix.stream");
        registrationBean.setName("HystrixMetricsStreamServlet");
        return registrationBean;
    }

 

你可能感兴趣的:(SpringCloud)