在网关配置文件中加上:
#防止请求超时
ribbon:
ReadTimeout: 5000
ConnectTimeout: 5000
MaxAutoRetries: 0
MaxAutoRetriesNextServer: 1
eureka:
enabled: true
hystrix:
command:
default:
excution:
timeout:
enabled: true
isolation:
thread:
timeoutInMilliseconds: 60000