搭建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。问题解决。