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