springboot2.0下hystrix dashboard Unable to connect to Command Metric Stream解决办法

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

springboot2.0下hystrix dashboard Unable to connect to Command Metric Stream解决办法_第1张图片

看到这篇文章http://blog.csdn.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 dashboard Unable to connect to Command Metric Stream解决办法_第2张图片

看看这个端点配置的地方

springboot2.0下hystrix dashboard Unable to connect to Command Metric Stream解决办法_第3张图片

来看看这个servlet

springboot2.0下hystrix dashboard Unable to connect to Command Metric Stream解决办法_第4张图片

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

springboot2.0下hystrix dashboard Unable to connect to Command Metric Stream解决办法_第5张图片

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

你可能感兴趣的:(java)