升級到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/