# hystrix 超时时间最好大于Ribbon ReadTimeout+ConnectTimeout的超时时间
hystrix:
command:
default:
execution:
isolation:
thread:
timeoutInMilliseconds: 30000
#对当前实例的重试次数
#切换实例的重试次数
#请求处理的超时时间
#请求连接的超时时间
#对所有操作请求都进行重试
ribbon:
MaxAutoRetries: 1
MaxAutoRetriesNextServer: 1
ReadTimeout: 5000
ConnectTimeout: 2000
OkToRetryOnAllOperations: true
我在配置了 Zuul的 熔断和重试以后 ,一直到ribbo超时后就直接返回错误编码 hystrix不生效,经过板砖发现 需要在zuul中加入
<dependency>
<groupId>org.springframework.retry</groupId>
<artifactId>spring-retry</artifactId>
<version>1.2.1.RELEASE</version>
</dependency>
加入就生效了