天天看點

spring cloud:Edgware.RELEASE版本hystrix逾時新坑

spring cloud:Edgware.RELEASE版本hystrix逾時新坑

更新到Edgware.RELEASE發現,zuul中不管如何設定hystrix的逾時時間均不起作用,仍然是預設的1000ms.  降回低版本後正常,但是低版本的fallback方法中,又拿不到詳細異常資訊,最終暫時在Edgware.RELEASE中,将hystrix的逾時關掉,參考以下配置:

ribbon:
  ReadTimeout: 5000
  ConnectTimeout: 5000
  MaxAutoRetries: 0
  MaxAutoRetriesNextServer: 1

hystrix:
  command:
    default:
      execution:
        timeout:
          enabled: false #Edgware.RELEASE中,timeoutInMilliseconds不起作用,暫時關掉
        isolation:
          thread:
            timeoutInMilliseconds: 10000

zuul:
  host:
    socket-timeout-millis: 10000
    connect-timeout-millis: 10000      

希望下個版本中,能盡快修複該問題。

2018-02-05 更新:Edgware.SR1中已經修複了該bug

參考文章:

1、hystrix 官方配置:https://github.com/Netflix/Hystrix/wiki/Configuration#execution.isolation.strategy

2、周立的spring-cloud逾時總結:http://www.itmuch.com/spring-cloud-sum/spring-cloud-timeout/ 

3、周立的spring-cloud重試總結:http://www.itmuch.com/spring-cloud-sum/spring-cloud-retry/

作者:菩提樹下的楊過

出處:http://yjmyzz.cnblogs.com

本文版權歸作者和部落格園共有,歡迎轉載,但未經作者同意必須保留此段聲明,且在文章頁面明顯位置給出原文連接配接,否則保留追究法律責任的權利。

繼續閱讀