原因:hystrix 熔断策略 慢调用默认是1秒,如果业务处理时长超过1秒,就会一直走降级

#熔断降级规则
hystrix:
  command:
    default:
      execution:
        isolation:
          thread:
            timeoutInMilliseconds: 5000 #默认是1秒,如果业务处理时长超过1秒,就会一直走降级

feign:
  hystrix:
    enabled: true  #开启使用hystrix
  client:
    config:
      stock-service:   #如果stock-service换成 default 表示所有服务
        connectTimeout: 10000
        readTimeout: 60000
        requestInterceptors[0]:  # 可以忽略
          com.ldj.cloud.interceptor.CustomFeignInterceptor

 

 

使用Sentinel组件 作为熔断降级

Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐