解決:The Hystrix timeout of ***ms for the command *** is set lower than the combination of the Ribbon read and connect timeout


項目具體報錯如下:

2019-09-19 17:46:48.283 [http-nio-7777-exec-3] WARN  o.s.c.n.z.f.route.support.AbstractRibbonCommand - The Hystrix timeout of 5000ms for the command SERVICE is set lower than the combination of the Ribbon read and connect timeout, 400000ms.

分析:

Ribbon 總時間ribbonTimeout = (ribbonReadTimeout + ribbonConnectTimeout) * (maxAutoRetries + 1) * (maxAutoRetriesNextServer + 1);
筆者這里的具體值為:(5000+5000)*(1+1)*(1+1)=40000;

而Hystrix 時間為:5000,具體辦法也好辦,在配置文件中修改超時為:
hystrix:
  command:
    default:
      execution:
        isolation:
          thread:
            timeoutInMilliseconds: 40000

 或者修改ribbon配置:

AUSERVICE:  #這是ribion要請求的serviceID
  ribbon:
    ReadTimeout: 2000
    ConnectTimeout: 2000
    MaxAutoRetries: 0
    MaxAutoRetriesNextServer: 0

即:(2000+2000)*(0+1)*(0+1)=4000<5000也可。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM