Greenwich Spring boot2.0之后hystrix.stream节点处理方法

问题:默认配置使用的:Hystrix

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

办法一:yml 配置文件方式解决 推荐

#熔断器DashBoard:actuator在springboot2.0调整后开关 web端点的配置,"**"代表开启所有
management:
  endpoints:
    web:
      exposure:
        include: "*"

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

注意:上面的 * 只有一个,你写两个发生灵异事件,本文不负责解释,可以尝试着玩一玩

办法二:配置一个Servlet 不推荐

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

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

 

放到Application.java内即可。想要见到刷数据,需要你调用你的hystrix有短路保护的借口哦,更多请参考如下:

《史上最简单的 SpringCloud 教程》

本文参考来源:

spring boot2.0之后不提供hystrix.stream节点处理方法

发布了90 篇原创文章 · 获赞 79 · 访问量 63万+

猜你喜欢

转载自blog.csdn.net/yexiaomodemo/article/details/103152559
今日推荐