zoukankan      html  css  js  c++  java
  • gateway简单配置

    server:
    port: 9927
    spring:
    application:
    name: gta-apigateway
    cloud:
    nacos:
    discovery:
    server-addr: 10.10.25.18:8848 # nacos服务地址
    namespace: a02ac5d9-a070-45b7-b951-409b8ea963b5
    group: SEATA_GROUP
    # Nacos 集群配置
    #server-addr: 10.10.25.15:8848,10.10.25.18:8848
    gateway:
    discovery:
    locator:
    enabled: true
    routes:
    - id: gta-taskchain-gateway
    uri: lb://gta-taskchain
    filters:
    - name: Hystrix
    args:
    name: default
    fallbackUri: 'forward:/defaultfallback'
    predicates:
    - Path=/gta-taskchain/doubleTask/**
    # - Header=luxToken, (^Tp.*)

    # hystrix 信号量隔离,3秒后自动超时
    hystrix:
    command:
    default:
    execution:
    isolation:
    strategy: SEMAPHORE
    thread:
    timeoutInMilliseconds: 3000
    shareSecurityContext: true

    @RestController
    public class DefaultHystrixController {
    @RequestMapping("/defaultfallback")
    public Map<String,String> defaultfallback(){
    Map<String,String> map = new HashMap<>();
    map.put("resultCode","fail");
    map.put("resultMessage","请稍后...");
    return map;
    }
    }

  • 相关阅读:
    ImageView一例
    TextView之一:子类的常用属性
    TextView之二:常用属性
    Android中的消息机制:Handler消息传递机制
    关于LayoutParams
    LinearLayout的一些注意事项
    支付宝扫描二维码登录网站
    Cok
    Cok
    STM32的USART
  • 原文地址:https://www.cnblogs.com/xgyweb/p/14764683.html
Copyright © 2011-2022 走看看