zuul网关中的配置:
zuul:
routes:
api-a:
path: /v1/userservice/**
serviceId: userservice-v1 #等价于zuul.routes.=
ignoredServices: ‘*’ #对任何服务都不自动创建路由
max:
host:
connections: 500
host:
socket-timeout-millis: 60000
connect-timeout-millis: 60000
#如果Zuul使用服务发现,则需要使用
ribbon:
ReadTimeout: 60000
ConnectTimeout: 60000
MaxAutoRetries: 0
MaxAutoRetriesNextServer: 1
eureka:
enabled: true
#熔断机制超时
hystrix:
command:
default:
execution:
timeout:
enabled: true
isolation:
thread:
timeoutInMilliseconds: 60000
服务单元的配置:
ribbon:
eureka:
enabled: true