Spring Cloud Hystrix 断路器

2017-09-30  本文已影响0人  maven_hz

本篇文章为Spring Cloud 各模块演示代码的分支[Hystrix]部分。
先从几个概念开始,了解概念有助于对Hystrix的理解。

熔断、降级、限流的概念

以上概念部分摘自 http://kaimingwan.com/post/jia-gou/shi-yong-hystrixwan-cheng-rong-duan-xian-liu-he-jiang-ji

Hystrix 代码示例

Hystrix DashBoard 服务压力查看器

1.在以上的Demo启动的基础上,启动 spring-cloud-03-hystrix-dashboard
2.访问 http://localhost:5001/hystrix

DashBoard
3.点击进入后可查看所有的请求情况
监控界面

Hystrix Turbine 集群服务压力查看器

1.在以上的基础上启动 spring-cloud-03-hystrix-request-b 和 集群收集模块turbine spring-cloud-03-hystrix-turbine
这时在dashboard中填入的地址为http://localhost:3000/turbine.stream
点击监控。分别请求 spring-cloud-03-hystrix-request-aspring-cloud-03-hystrix-request-b 的API之后。会发现在监控平台上的Hosts变为了2.两个客户端的请求都能被监控了。


END

上一篇 下一篇

猜你喜欢

热点阅读