Ocelot
Ocelot copied to clipboard
How to avoid calling down service in load balancer option
Expected Behavior / New Feature
Load balancer should able to recognize the down service and stop calling service or up the service.
Actual Behavior / Motivation for New Feature
Load balancer is calling the service although the service is down and returning 500 internal server on every call.
Steps to Reproduce the Problem
- Created two instance of the same module and run on different port.
- Added load balance option for those two service instance of type RoundRobin.
- Kill the second service and now Ocelot still redirect to down service.
Specifications
- Version: 13.5.2
- Platform: Windows 10
- Subsystem:
Maybe you should use Service Discovery
to solve this problem.
@catcherwong Is it possible without Service Discovery?
Without Service Discovery, you should remove the down service from the configuration by yourself.
Or you can set QoSOptions
to ensure the quality of service.
https://ocelot.readthedocs.io/en/latest/features/qualityofservice.html
@catcherwong Thanks for your prompt reply but I don't think it will solved my problem. A QoS will just manipulate the status code to 503 from 500 but I want the Ocelot should able to UP the down service.
Do you know any other open source "API Gateway" which could help me with this situation?
A QoS will just manipulate the status code to 503 from 500 but I want the Ocelot should able to UP the down service.
Do you want to start up a down service via Ocelot?
Ocelot just forwards the requests to the downstream service.
If a service is not working properly, Ocelot can stop calling or enable CircuitBreaker
to reduce the pressure on this service.
But Ocelot can not restore a down service to normal service.
Have any way to skip DownstreamHostAndPorts is not work? I have 5 port in DownstreamHostAndPorts and port at index 4 or else is not work(service stop by any problem). I need to let it skip that index automatically.
@uvcreation commented on Oct 17, 2019 Hi Uttam!
@catcherwong Thanks for your prompt reply but I don't think it will solved my problem. A QoS will just manipulate the status code to 503 from 500 but I want the Ocelot should able to UP the down service.
Sorry! And this issue will be fixed as a part of #1513 Do you like status 503 in QoS or not?
Do you know any other open source "API Gateway" which could help me with this situation?
You could try awesome lite .NET gateway with the name ProxyKit :wink: ...which is in Archive :rofl: But, come on! Why not to stay with Ocelot? :tiger:
@catcherwong commented on Oct 17, 2019:
Maybe you should use
Service Discovery
to solve this problem.
Yes, Consul has health checks feature: Define health checks Use service discovery by our Consul provider package.
@uvcreation commented on Oct 17, 2019:
@catcherwong Is it possible without Service Discovery?
Impossible! What you need is Health Check feature. This feature is not implemented in Ocelot. We will prioritize the feature development, but any help and opened PRs are welcome!
@ggnaegi @RaynaldM I've assigned high priority to this issue. Because there is no open PR at all, I have no idea when we can start development of Health Checks... I will add to March'24 milestone but I'm not sure about our team capacity.
Ocelot is a package that brings Gateway functionality to an asp.net core application. I believe that all the natural decorum of an asp.net core application (healthCheck, Cors, StaticFiles, etc...) is the responsibility of the developer and should not be included in the Ocelot package.
@ggnaegi Your opinion, Gui?