hystrix实战总结;

HystrixCircuitBreaker 有三种状态 :

断路器默认是20个请求失败才打开短路器,可以进行配置:

 

CLOSED :关闭

OPEN :打开

HALF_OPEN :半开

 

 

1、接口正确,接口报超时;

https://www.cnblogs.com/EasonJim/p/7722372.html

2、springboot2.0后使用hystrix的监控必须得加:因为默认不是hystrix.stream

@Bean
    public ServletRegistrationBean getServlet() {
        HystrixMetricsStreamServlet streamServlet = new HystrixMetricsStreamServlet();
        ServletRegistrationBean registrationBean = new ServletRegistrationBean(streamServlet);
        registrationBean.setLoadOnStartup(1);
        registrationBean.addUrlMappings("/hystrix.stream");
        registrationBean.setName("HystrixMetricsStreamServlet");
        return registrationBean;
    }

  加上后监控器才可以访问

3、hystrix的的fallback触发机制详细介绍,这个博文非常好!!!!!!!

fallback触发;

https://blog.csdn.net/tongtong_use/article/details/78611225 

https://blog.csdn.net/jack281706/article/details/73743024(也很详细)

 

转载于:https://www.cnblogs.com/fengli9998/p/9257181.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值