springboot 1.5 的时候  springcloud 添加 断路器仪表盘  按照网上的方法是没有问题的  但是 springboot2.0的时候一直无法连接

所以需要添加

@Bean
public ServletRegistrationBean getServlet(){
HystrixMetricsStreamServlet hystrixMetricsStreamServlet = new HystrixMetricsStreamServlet();
ServletRegistrationBean registrationBean = new ServletRegistrationBean(hystrixMetricsStreamServlet);
registrationBean.setLoadOnStartup(1);
registrationBean.addUrlMappings("/hystrix.stream");
registrationBean.setName("HystrixMetricsStreamServlet");
return registrationBean;
}
05-11 16:21