搭建Zuul工程時,用的SpringCloud版本爲Edgware.RELEASE(沒上更高的版本,因爲部署環境tomcat和jdk的限制,更高的怕不兼容)。在改網關斷路器的超時時間時,試了各種姿勢,從zuul本身到ribbon到hystrix配置,均無法生效。試過的配置參數如下:
zuul:
zuul.retryable=true zuul.ribbon-isolation-strategy=thread
zuul.host.connect-timeout-millis=30000 zuul.host.socket-timeout-millis=30000ribbon:
ribbon.ReadTimeout=30000 ribbon.SocketTimeout=30000hystrix:
hystrix.command.default.execution.timeout.enable=false hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=60000 hystrix.command.default.execution.isolation.thread.ribbon.ReadTimeout=30000 hystrix.command.default.execution.isolation.thread.ribbon.ConnectTimeout=30000超時設置依舊沒有成功,zuul的超時斷路依舊是默認的2s。google各種方案無解,只能降級爲Dalston.SR5。問題解決。