当在springcloud项目时候搭建springcloud -hystrix-dashboard ,如果父亲采用spring boot 2.0以上 一般需要在appliation加入注解
@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; } }
如仅仅是以普通项目开头的则是无需加上版本