在服务端加上,就ok了
@Bean
public ServletRegistrationBeangetServlet() {
HystrixMetricsStreamServlet streamServlet =new HystrixMetricsStreamServlet();
ServletRegistrationBean registrationBean =new ServletRegistrationBean(streamServlet);
registrationBean.setLoadOnStartup(1);
registrationBean.addUrlMappings("/hystrix.stream");
registrationBean.setName("HystrixMetricsStreamServlet");
return registrationBean;
}
网友评论