在zuul网关模块以及需要调用其他微服务的模块配置:
# 配置Ribbon超时时间
ribbon:
ReadTimeout: 10000
ConnectTimeout: 10000
# 对所有操作请求都进行重试
OkToRetryOnAllOperations: true
# 对当前实例的重试次数
MaxAutoRetries: 1
# 切换实例的重试次数
MaxAutoRetriesNextServer: 2
# 配置hystrix超时时间
hystrix:
command:
default:
execution:
timeout:
enabled: true
isolation:
thread:
timeoutInMilliseconds: 60000