zuul集成了ribbon 和hystrix
如果調用的遠程服務沒有正常返回結果,又沒有設置熔斷機制,就會上述錯誤。
因為redis的docker忘記啟動了。
正常調用的情況就不會出現該錯誤,所有還要設置熔斷機制,不然超時的參數時間怎么設置也沒用
zuul:
host:
connect-timeout-millis: 15000 #HTTP連接超時要比Hystrix的大
socket-timeout-millis: 60000 #socket超時
#ribbon 隨服務啟動,不使用lazy load
ribbon:
eager-load:
enabled: true
hystrix:
command:
default:
execution:
isolation:
thread:
timeoutInMilliseconds: 60000