Ocelot的使用和注意

{
  "DownstreamPathTemplate": "/product",// "/{matchall}",//这里使用{matchall} 并配合下面会导致多出讴歌product
  "DownstreamScheme": "https",
  // "UpstreamPathTemplate": "/product/{matchall}",//注释下面使用这里配合上面注释的会多出一个product..链接变成 localhost/procduct/product,反之就去掉一个product
  "UpstreamPathTemplate": "/product",
  "UpstreamHttpMethod": [ "Get", "Post" ],
  "ServiceName": "productservice",
  "UseServiceDiscovery": true,
  "LoadBalancerOptions": {
    "Type": "RoundRobin"
  },
  "FileCacheOptions": {
    "TtlSeconds": 3,
    "Region": "product"
  },
  //"RateLimitOptions": {
  //  "ClientWhitelist": [],
  //  "EnableRateLimiting": true,
  //  "Period": "1s",
  //  "PeriodTimespan": 1,
  //  "Limit": 1
  //},
  "QoSOptions": {
    "ExceptionsAllowedBeforeBreaking": 1,
    "DurationOfBreak": 3000,
    "TimeoutValue": 5000
  },
  "AuthenticationOptions": {
    "AuthenticationProviderKey": "productService",
    "AllowScopes": []
  }
},

  代理后链接多出一个 字段用上面

posted @ 2024-06-24 19:12  孤海飞雁  阅读(15)  评论(0)    收藏  举报