转: springboot2.0下hystrix.stream 404

时间:2023-03-09 09:04:44
转: springboot2.0下hystrix.stream 404

springboot2.0下hystrix dashboard Unable to connect to Command Metric Stream解决办法
https://blog.****.net/ddxd0406/article/details/79643059

最近在学习springcloud,实践hystrix dashboard仪表盘的时候,不管是按照书上的还是网上的,都提示Unable to connect to Command Metric Stream。

转: springboot2.0下hystrix.stream 404

看到这篇文章http://blog.****.net/qq_20094989/article/details/79530995说springboot2.0不行,1.5可以,试了一下果然行,那2.0为什么不行呢?

项目环境:

spring-boot-starter-parent 2.0.0.RELEASE

spring-cloud-starter-parent Finchley.M8

其余所需jar和网上的文章一样,可直接参考链接文章,感谢链接作者。

来翻翻源码

我们很容易就找到 hystrix.stream 这个端点

转: springboot2.0下hystrix.stream 404

看看这个端点配置的地方

转: springboot2.0下hystrix.stream 404

来看看这个servlet

转: springboot2.0下hystrix.stream 404

真相大白了,我们只要在自己的项目里配置上这个servlet就ok了,如下

转: springboot2.0下hystrix.stream 404

综上,按照网上的方法配置好后,再多配置这个servlet就ok。