{
  "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同步配置
    }
  }
}

 

相关文章:

  • 2021-10-12
  • 2022-02-25
  • 2022-12-23
  • 2021-09-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-31
  • 2021-11-10
猜你喜欢
  • 2021-11-08
  • 2022-03-09
  • 2021-05-17
  • 2021-06-01
  • 2021-04-20
相关资源
相似解决方案