ThreeMammals / Ocelot

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

Ocelot configuration and routing queries #1796

Closed SheruGaur closed 11 months ago

SheruGaur commented 11 months ago

Discussed in https://github.com/ThreeMammals/Ocelot/discussions/1795

Originally posted by **SheruGaur** November 21, 2023 Hi, We are internally doing a POC on ocelot as API Gateway in our organisation. While we really like the product till now, we had few basic queries. we didnt find much in documentation or the issues and discussion. If someone from their experience can share some info on following it will be helpful. 1. How many maximum routes can be configured in Ocelot.Json? 2. Any limitations for define maximum routes in configuration file? 3. Any standard configuration for which this has been tested? 4. in case of multiple configuration files, does Ocelot allow the change in individual config files to be updated in the merged ocelot.json at runtime? 5. Do we need to create an ocelot.global.json file for where multiple config files configuration to work? Pls help with any references... Thanks Sheru
raman-m commented 11 months ago

Actually, it is not discussed!

raman-m commented 11 months ago

Read more: Configuration

ks1990cn commented 11 months ago

Hi @SheruGaur ,

Here are your answers:

1.) There is no maximum limit for routes you can define in Ocelot.Json. Internally code to uses simply list public List<Route> Routes { get; }. Just having huge number of routes with heavy configuration may impact startup/ search time for downstream route mapping. But I am pretty sure It can handle thousands / Lakhs without much impact on startup/map to downstream route.

2.) No there is no limit.

3.) There are few samples you can refer for what you are looking for, every where its tested ok. Ocelot have nice standards for test cases. https://ocelot.readthedocs.io/en/latest/ https://learn.microsoft.com/en-us/dotnet/architecture/microservices/multi-container-microservice-net-applications/implement-api-gateways-with-ocelot You can discuss with us, we can help you in understanding things you need.