首页 > 其他 > 详细

ocelot + consul 配置

时间:2020-03-13 19:33:34      阅读:204      评论:0      收藏:0      [点我收藏+]
{
  "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同步配置
    }
  }
}

 

ocelot + consul 配置

原文:https://www.cnblogs.com/czcz1024/p/12487765.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!