ThreeMammals / Ocelot

.NET API Gateway
https://www.nuget.org/packages/Ocelot
MIT License
8.28k stars 1.63k forks source link

Apply rate limiting globally #1915

Closed erick20 closed 7 months ago

erick20 commented 7 months ago

this is my configuration that is not working globally

"GlobalConfiguration": {
    "BaseUrl": "https://localhost:5002",
    "RateLimitOptions": {
      "DisableRateLimitHeaders": true,
      "QuotaExceededMessage": "Exceed ",
      "HttpStatusCode": 400,
      "ClientWhitelist": [],
      "EnableRateLimiting": true,
      "Period": "10s",
      "PeriodTimespan": 3,
      "Limit": 1
    }
  }

when i'm adding this to a specific route it is working

  "RateLimitOptions": {
      "ClientWhitelist": [],
      "EnableRateLimiting": true,
      "Period": "10s",
      "PeriodTimespan": 3,
      "Limit": 1
    }

is there any option to setup rate limiting globally that will affect to my all endpoints?

raman-m commented 7 months ago

This is where the global load balancer and rate limit options apply.

raman-m commented 7 months ago

Hi Erick! Is it the question or feature request? 😉 Now you are able to use global Rate Limiting in case of Dynamic Routing only. My complete answer is here

raman-m commented 7 months ago

Duplicate of #1598, #1229, #585

raman-m commented 7 months ago

Do you have intention to contribute to develop this global feature?

raman-m commented 7 months ago

There is no intention... 🆗

Erick, When we will start working on #1229 we will reopen this your issue to allow you to watch for the development & delivery of the feature. Stay with Ocelot! 💪