feign + hystrix 监控和熔断测试(Spring Cloud)
2020-01-14 04:56
781 查看
1 修改sp09-feign项目
1) pom.xml 添加 hystrix 起步依赖
feign 没有包含完整的 hystrix 依赖
右键点击项目,编辑起步依赖,添加hystrix依赖
2) 主程序添加 @EnableCircuitBreaker
3) sp09-feign 配置 actuator,暴露 hystrix.stream 监控端点 actuator 依赖
查看pom.xml, 确认已经添加了 actuator 依赖
4) application.yml 暴露 hystrix.stream 端点
5) 启动服务,查看监控端点
http://localhost:3001/actuator
6) hystrix dashboard
启动 hystrix dashboard 服务,填入 feign 监控路径,开启监控
访问 http://localhost:4001/hystrix
填入 feign 监控路径:
http://localhost:3001/actuator/hystrix.stream
访问微服务,以产生监控数据
http://localhost:3001/item-service/35
http://localhost:3001/user-service/7
http://localhost:3001/user-service/7/score?score=100
http://localhost:3001/order-service/123abc
http://localhost:3001/order-service/
2 熔断测试
1) 用 ab 工具,以并发50次,来发送20000个请求
2) 断路器状态为 Open,所有请求会被短路,直接降级执行 fallback 方法
- 点赞
- 收藏
- 分享
- 文章举报
相关文章推荐
- SPRINGCLOUD-熔断监控HYSTRIX DASHBOARD和TURBINE
- springcloud(五):熔断监控Hystrix Dashboard和Turbine
- 嗡汤圆的Spring Cloud自学(PART.3):API熔断与监控(hystrix)
- springcloud(五):熔断监控Hystrix Dashboard和Turbine
- springcloud(5):熔断监控Hystrix Dashboard和Turbine
- SpringCloud Feign+Hystrix搭建微服务监控
- 学习笔记:微服务12 spring cloud Feign(Rest请求)+ hystrix(熔断)
- Spring Boot + Spring Cloud 构建微服务系统(五):熔断监控面板(Hystrix Dashboard)
- springcloud(五):熔断监控Hystrix Dashboard和Turbine
- spring cloud 系列第5篇 —— hystrix+turbine 服务的熔断与监控 (F版本)
- springcloud(五):熔断监控Hystrix Dashboard和Turbine
- SpringCloud之熔断监控Hystrix Dashboard的实现
- springcloud(五):熔断监控Hystrix Dashboard和Turbine 2017/05/18
- springcloud(五):熔断监控Hystrix Dashboard和Turbine
- springcloud(五):熔断监控Hystrix Dashboard和Turbine
- 微服务SpringCloud之熔断监控Hystrix Dashboard和Turbine
- 玩转Spring Cloud之熔断降级(Hystrix)与监控
- springcloud 熔断监控Hystrix Dashboard和Turbine
- Spring Cloud(八)熔断监控Hystrix Dashboard和Turbine
- springcloud(五):熔断监控Hystrix Dashboard和Turbine