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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM