How to change the balancing payload depending on http status code? #2140
-
Hi, I have a use case that I have 2 downstream servers. Depending on the response on the first server, I would like to either :
Is it something supported? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hello!
It appears that your production environment is relatively small, considering you have a use case involving only two downstream servers. 😃
No❕Currently, there is no official functionality for such a scenario. However, you can create a custom solution. You would need to develop a Custom Load Balancer that will select the second server based on the response from the first one. Additionally, you'll need to implement a special Delegating Handler to capture the response status and store it in Should you decide to proceed with development and require further consultation, please contact us to discuss a development roadmap. P.S. Please inform us if there are other gateways with similar functionality. |
Beta Was this translation helpful? Give feedback.
-
Hi, thanks for the anwser. About the size, I said 2 downstream servers but in reality, it's more an container with ocelot loaded as a sidecar that will call an API outside to endpoint1 and if this one return a http code different from 200, we call endpoint2 or replace payload with 302 to call that other endpoint2. About others gateway that could support that use case, Broadcom/VMware (formely Layer7) do that kind of use case but invole much more stuff that just a sidecar container. Thanks |
Beta Was this translation helpful? Give feedback.
Hello!
Welcome to Ocelot world! 🐯
It appears that your production environment is relatively small, considering you have a use case involving only two downstream servers. 😃
No❕
Currently, there is no official functionality for such a scenario. However, you can create a custom solution. You would need to develop a Custom Load Balancer that will select the second server based on the response from…