1. 程式人生 > 其它 >gateway閘道器配置轉發和熔斷配置

gateway閘道器配置轉發和熔斷配置

##伺服器埠配置
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