tencent是什么 tencent是什么文件夹( 二 )

  • 提供 Feign 服务调用实现
@FeignClient(contextId = "demoFeign", value = https://www.fajihao.com/i/"lengleng-circuitbreaker-tencent-circuitbreaker-provider",fallback = DemoFeignFallback.class)public interface DemoFeign {@GetMapping("/provider")String get(@RequestParam String name);}
  • 服务访问 polaris-circuitbreaker
spring:cloud:polaris:address: grpc://127.0.0.1:8091#开启断路器feign:circuitbreaker:enabled: true
  • 编写熔断规则 polaris.yml
consumer:circuitBreaker:checkPeriod: 100mschain:- errorCount- errorRateplugin:errorCount:continuousErrorThreshold: 1metricNumBuckets: 1errorRate:errorRateThreshold: 100metricStatTimeWindow: 1srequestVolumeThreshold: 1