1. 程式人生 > >SpringCloud:Feign呼叫超時解決方案

SpringCloud:Feign呼叫超時解決方案

                                             解決消費者呼叫超時報錯的問題(除錯的時候 用的到)

線上環境酌情處理配置

 

共三種方案:可選其中一種應用

1、修改超時時間

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


2、把超時發生異常屬性關閉

hystrix:
  command:
      default:
        execution:
          timeout:
            enabled: false


3、禁用feign的hystrix


feign:
  hystrix:
    enabled: false