Sentinel 降级规则

3种降级策略

RT

在设定的毫秒次数没有得到响应并超过5次就会触发降级
降级时间为后面你填的时间
测试使用:

public class Test {
    public static void main(String[] args) throws InterruptedException {
        RestTemplate restTemplate =new RestTemplate();
        for (int i = 0; i < 100; i++) {
            restTemplate.getForObject("http://localhost:8180/getPort",String.class);
            Thread.sleep(10);
        }
    }
}

可以发现一定次数后的请求失败了

异常比例


很好理解 就是请求异常与正常的比例超过设定的值 就触发降级

异常数

一分钟的异常数超过值就触发降级

posted @ 2021-11-01 20:00  一个经常掉线的人  阅读(83)  评论(0)    收藏  举报