spring-cloud-gateway timeout configuration
- Connection timed out
- Read timeout
Global timeout configuration
# 单位毫秒
server:
port: 8080
spring:
application:
name: api-gateway
cloud:
gateway:
httpclient:
# 连接超时
connect-timeout: 5000
# 读取超时
response-timeout: 15000
Individual interface timeout configuration
# 单位毫秒
server:
port: 8080
spring:
application:
name: api-gateway
cloud:
gateway:
routes:
- id: demo
uri: lb://demo
predicates:
- Path=/demo/**
metadata:
# 读取超时
response-timeout: 5000
# 连接超时
connect-timeout: 30000