##服务器端口配置
server:
port: 10001
spring:
application:
name: operate-gateway-dev
cloud:
nacos:
discovery:
server-addr: 10.210.12.87:8849 #配置Nacos地址\
gateway:
routes:
- id: url-proxy-0 #文件导出接口,单独设置超时时间
uri: lb://ymall-overseas-dev #lb://服务名
predicates:
- Path=/lhwTest/lhw/order/export
filters:
- name: Hystrix
args:
name: fallbackExp
fallbackUri: forward:/fallBack
- id: url-proxy-1 #转发到lhwTest接口
uri: lb://lhwTest-dev #lb://服务名
predicates:
- Path=/lhwTest/**
filters:
- name: Hystrix
args:
name: fallbackcmd
fallbackUri: forward:/fallBack
- id: url-proxy-2 #转发到lhwTest2接口
uri: lb://lhwTest2-dev #lb://服务名
predicates:
- Path=/lhwTest2/**
filters:
- name: Hystrix
args:
name: fallbackcmd
fallbackUri: forward:/fallBack
# Hystrix 配置
hystrix:
command:
default:
execution:
isolation:
thread:
timeoutInMilliseconds: 6000 #默认超时时间
fallbackcmd:
execution:
isolation:
thread:
timeoutInMilliseconds: 2000 # Hystrix 的 fallback 时间
fallbackExp:
execution:
isolation:
thread:
timeoutInMilliseconds: 60000 # Hystrix 的 fallback 时间
threadpool:
default:
coreSize: 100 # Hystrix 更改默认并发数配置
logging:
config: classpath:log4j2-dev.xml