- 报错描述
服务重启后第一次访问调用Feign接口会503,走熔断器的fallback
打一次断点后再访问就没有问题,服务重启后第一次访问打断点也是503
- 解决方案
Hystrix缺省超时判断为1秒钟,由于网络问题,有些请求超过1秒钟之后才接收到
增加响应时间即可
hystrix:
command:
default:
execution:
isolation:
thread:
timeoutInMilliseconds: 10000 #超时设置10s
- HystrixRuntimeException available exception timed-out fallbackhystrixruntimeexception exception timed-out hystrixruntimeexception available exception timed-out hystrixruntimeexception fallback 缓存fallback机制 blockhandler sentinel fallback specified fallback endpoint blazor fallback sentinel feign springcloud openfeign sentinel fallback