Skip to content

How to change the balancing payload depending on http status code? #2140

Answered by raman-m
milapointe asked this question in Q&A
Discussion options

You must be logged in to vote

Hello!
Welcome to Ocelot world! 🐯

I have a use case that I have 2 downstream servers.

It appears that your production environment is relatively small, considering you have a use case involving only two downstream servers. 😃

Depending on the response on the first server, I would like to either :

  • Call the second downstream server only on http code 429
    or
  • Change the payload and http code so that I can add a set location 302 to another api

Is it something supported?

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…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by raman-m
Comment options

You must be logged in to vote
2 replies
@raman-m
Comment options

@raman-m
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
Load Balancer Ocelot feature: Load Balancer Delegating Handlers Ocelot feature: Delegating Handlers
2 participants