版本
java.version 13spring-boot 2.2.3.RELEASEspring-cloud Hoxton.SR3
问题
原因
springboot默认路径为"/"需要修改为"/hystrix.stream"
HystrixMetricsStreamServlet源码中给出通过xml配置
再springboot中我们可以采用@Bean方式配置
解决方法
增加
@Beanpublic ServletRegistrationBean getServlet() {HystrixMetricsStreamServlet streamServlet = new HystrixMetricsStreamServlet();ServletRegistrationBean registrationBean = new ServletRegistrationBean(streamServlet);registrationBean.setLoadOnStartup(1);registrationBean.addUrlMappings("/hystrix.stream");registrationBean.setName("HystrixMetricsStreamServlet");return registrationBean;}
或者yml文件中加入
management:enabled: falseendpoints:web:exposure:include: hystrix.streambase-path: /
重启一下ok