Fork me on GitHub

SpringCloud Feign Hystrix 超时时间设置

SpringCloud Feign Hystrix 超时时间设置


 

ymal 配置文件中,添加如下信息

feign:
  client:
    config:
      default:
        connect-timeout: 5000
        read-timeout: 5000
  hystrix:
    enabled: true

hystrix:
  command:
      default:
        execution:
          isolation:
            thread:
              timeoutInMilliseconds: 5000

【说明】:

enabled: true 表示 开启 Hystrix 熔断器

connect-timeout: feign客户端建立连接超时时间

read-timeout:feign客户端建立连接后读取资源超时时间

timeoutInMilliseconds:超时时间(默认1000ms)在调用方配置,被该调用方的所有方法的超时时间都是该值

 

posted @ 2020-12-23 00:06  龙凌云端  阅读(1833)  评论(0编辑  收藏  举报