默认的请求时间为1秒,超过这个时间便超时异常。那么顺着这个思路我们有如下解决方式:

1、把时间设长

这里设置5秒

 

[html] view plain copy
  1. hystrix:  
  2.   command:  
  3.       default:  
  4.         execution:  
  5.           isolation:  
  6.             thread:  
  7.               timeoutInMilliseconds: 5000  

2、把超时发生异常属性关闭

 

[html] view plain copy
  1. hystrix:  
  2.   command:  
  3.       default:  
  4.         execution:  
  5.           timeout:  
  6.             enabled: false  

3、禁用feign的hystrix

 

[html] view plain copy
  1. feign:  
  2.   hystrix:  
  3.     enabled: false  


这三种任意一种都能解决问题,已经实践过,只需要修改application.yml中添加这些配置即可。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-17
  • 2021-10-28
  • 2021-11-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-04-08
  • 2022-12-23
  • 2021-11-06
  • 2022-12-23
  • 2021-07-09
  • 2022-02-08
  • 2021-08-19
相关资源
相似解决方案