默認的請求時間為1秒,超過這個時間便超時異常。那么順着這個思路我們有如下解決方式:
1、把時間設長
這里設置5秒
- hystrix:
- command:
- default:
- execution:
- isolation:
- thread:
- timeoutInMilliseconds: 5000
2、把超時發生異常屬性關閉
- hystrix:
- command:
- default:
- execution:
- timeout:
- enabled: false
3、禁用feign的hystrix
- feign:
- hystrix:
- enabled: false
這三種任意一種都能解決問題,已經實踐過,只需要修改application.yml中添加這些配置即可。