zoukankan      html  css  js  c++  java
  • ocelot + consul 配置

    {
      "ReRoutes": [
        {
          "UpstreamPathTemplate": "/api/lev2/test",//对外发布的路径
          "UpstreamHttpMethod": [ "Get" ],
    
          "DownstreamPathTemplate": "/test",//下游真实api路径
          "DownstreamScheme": "http",
          //"DownstreamHostAndPorts": [
          //  {
          //    "host": "localhost",//下游服务器ip端口
          //    "port": 5002
          //  }
          //],
          "ServiceName": "ApiLev2",//下游服务在consul注册的名称
          "LoadBalancerOptions": {
            "Type": "LeastConnection"
          },
          "UseServiceDiscovery": true
        }
      ],
      "GlobalConfiguration": {
        //"BaseUrl": "https://localhost:5222",//本服务地址
        "ServiceDiscoveryProvider": {
          "Host": "localhost",//consul的ip端口
          "Port": 8500,
          "Type": "PollConsul",
          "PollingInterval": 100,
          "ConfigurationKey": "Oceolot_A" //从consul同步配置
        }
      }
    }
  • 相关阅读:
    页面滚动
    tcbRouter
    http缓存策略
    Ajax跨域
    tcp 3次握手和4次挥手
    http头字段
    http工作原理
    一个下载Windows镜像的地址
    安装MySQL-8.0.13
    配置Java,jdk环境变量
  • 原文地址:https://www.cnblogs.com/czcz1024/p/12487765.html
Copyright © 2011-2022 走看看