Loading

[hystrix] 常用的HystrixCommand配置

@HystrixCommand(fallbackMethod = "fallback",   //降级方法
            commandProperties = {
                    @HystrixProperty(name = "circuitBreaker.enabled", value = "true"),
                    @HystrixProperty(name = "circuitBreaker.requestVolumeThreshold", value = "10"),   //请求次数
                    @HystrixProperty(name = "circuitBreaker.sleepWindowInMilliseconds", value = "10000"),  //时间范围 10s
                    @HystrixProperty(name = "circuitBreaker.errorThresholdPercentage", value = "60"), //失败率达到60%
                    @HystrixProperty(name = "circuitBreaker.sleepWindowInMilliseconds", value = "10000"), //等待恢复时间
            })
posted @ 2022-09-25 22:39  丘丘CRUD  阅读(117)  评论(0)    收藏  举报