spring cloud 的监控turbine

网友投稿 241 2023-08-07

spring cloud 的监控turbine

前提是你已经有了注册中心,然后搭建一个基础spring cloud 服务,并配置注册服务等等前提环境搭建

接下来描述的服务提供者和服务调用者的配置都是一样的,来自《spring cloud 与 docker微服务架构实战》的读后的个人总结.

pom文件中需要引入spring-cloud-starter-hystrix/spring-cloud-starter-hystrix-dashboard/spring-cloud-netflix-hystrix-stream/spring-cloud-starter-turbine-stream/spring-cloud-starter-stream-rabbit

如下

org.springframework.cloud

spring-cloud-starter-hystrix

org.springframework.cloud

spring-cloud-starter-hystrix-dashboard

org.springframework.cloud

spring-cloud-netflix-hystrix-stream

org.springframework.cloud

spring-cloud-starter-turbine-stream

org.springframework.cloud

spring-cloud-starter-turbine-stream

org.springframework.cloud

spring-cloud-starter-stream-rabbit

启动类需要添加如下注解

/*turibine监控*/

@EnableTurbineStream

@EnableCircuitBreaker

/*Dashboard监控*/

@EnableHystrixDashboard

接下来的操作才是关键

1,将注册中心 服务提供者 服务调用者 都启动

2.访问服务提供者 ip:port/hystrix 如图

3. 图中总共有三个文本框,其中第一个文本框是必填的,填写的是服务调用者的 ip:port/hystrix.stream,然后点击Monitor Stream.

4. 注意,如果第一个文本框填写的不正确会展示如下内容

5. 访问服务调用者,当然,该服务调用者提供的接口需要调用服务提供者提供的接口的

6.这时候就能看到如下内容,就证明你成功了

访问hystrix.stream

访问该连接时,想要出现如下的情况

这个就要访问服务提供者的 ip:port/hystrix.streahttp://m

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:Java使用策略模式解决商场促销商品问题示例
下一篇:Spring Boot+maven打war包的方法
相关文章

 发表评论

暂时没有评论,来抢沙发吧~