For RESTful APIs in APIgateway i am trying to implement Load Balancer Routing. I have configured 2 endpoints behind the load balancer policy.
In case of success, its working fine, i.e., traffic is routing to one of the two endpoints.
But in case of failure response from the native service, the load balancer routing starts mis-behaving. It triggers a second call as well, i.e., in case of failure 2 endpoints are being invoked.
Kindly guide me whether i am missing some silly configuration or this how it is supposed to behave.
Just tested with SOAP APIs, this is working fine even in case of failures.
let me know if you are seeing the behavior as below.
if you have configured your load balancer routing as lb1 and lb2. if Client Request is received and load balancer policy invoked is it will go to lb1 if that fails due to connection/read time out API gateway will suspend the load balancer endpoint lb1 for specified time ( seconds ) and try to route same request to the next available that lb2. if that is success it will response back to the client. its vice versa .This is expected behavior. Because load balancing routing policy inherit the same behavior which centra-site does had for SOAP request.
if you see anything else , Kindly elaborate more and share us the configuration of the load balancing routing.
I have a RESTful API created in APIGateway with 2 endpoints lb1 and lb2 configured in the load balancer policy. Once the client request is received and load balancer policy is invoked it is going to lb1/lb2 depending on the load balancer policy. The native service for the endpoint is also invoked…
If the native service responds some error (not a connectivity problem but an error response from native service), the request is routed to the other endpoint where it again fails. The failure is coming from the catch block of the native service itself.
For the load balancer configuration, i just used the 2 endpoints alias as below and no specific configurations
Also as mentioned, this behavior is not consistent with the SOAP APIs, For SOAP APIs, once the native service responds with an error, the API doesnot route to the other endpoint.
Hope this explains better. Let me know in case of any further clarification required for the same.
In your case its routing to another node after the native failure even which is not transient error. Can you verify the error code which you consuming from the native service to see if something is not normal. if not raise the tickets.