hystrix实战总结;

1、接口正确,接口报超时;

https://www.cnblogs.com/EasonJim/p/7722372.html

2、springboot2.0后使用hystrix的监控必须得加:因为默认不是hystrix.stream

@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;
    }

  加上后监控器才可以访问

猜你喜欢

转载自www.cnblogs.com/fengli9998/p/9257181.html