Failover routing in Edge Microgateway

Hi,

We have two target servers (A & B). We need to always route request to target server A but in case it is returning 5XX error code then we need to call target server B.

Is there a way we can do this? Or what approach we need to follow if we have to build this in custom plugin.

Thanks,

Anup Rai

0 2 173
2 REPLIES 2

Please review the load balancing configuration, in particular the IsFallback configuration

https://docs.apigee.com/api-platform/deploy/load-balancing-across-backend-servers

Apologies: I noted after replying that your question is in reference to the microgateway.

I'm not aware of any out of the box functionality for microgateway for this. You should consider using a load balancer between microgateway and your targets or create a custom plugin to do this

Can you please suggest the approach we need to follow for doing this in custom plugin.

Do we need to call the target server B in onresponse event function using node js after checking the status code of target server A or is there any other better approach?