背景
- springCloud:Finchley.RELEASE
官方建议
当Ribbon客户端和hystrix同时使用时,您需要确保您的hystrix超时时间配置比Ribbon超时时间更长,包括可能进行的重试。例如,如果您的Ribbon连接超时为1秒,而Ribbon客户端可能会重试该请求3次,则hystrix超时应该略大于3秒。
官方原文:When using Hystrix commands that wrap Ribbon clients you want to make sure your Hystrix timeout is configured to be longer than the configured Ribbon timeout, including any potential retries that might be made. For example, if your Ribbon connection timeout is one second and the Ribbon client might retry the request three times, than your Hystrix timeout should be slightly more than three seconds.