您的当前位置:首页正文

踩坑Hystrix:报错Unable to connect to Command Metric Stream

2024-11-30 来源:个人技术集锦

报错提示如下:

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

最后重启微服务,故障解决√

显示全文