<TargetEndpoint name="default">
<HTTPTargetConnection>
<LoadBalancer>
<Algorithm>RoundRobin</Algorithm>
<Server name="target1" />
<Server name="target2">
<IsFallback>true</IsFallback>
</Server>
</LoadBalancer>
<Path>/test</Path>
</HTTPTargetConnection>
</TargetEndpoint>
Above is the isFallback snippet and below are my questions on it
1. If target 1 failed, request will route to target 2 within the same call or from subsequent (from 2nd call) requests will start routing to target 2?
2. If it tried within the same call, will latency will increase? bcoz request tries with target 1 and failed and tried with target 2.
3. And how requests know when it starts routing to target 1 when it was up and running.
4. What error scenarios it will consider as a failure and choose the fallback?
Thanks in adavance.
Hi @Aravind, to your first question, that depends on the Retry configuration (default is true, so yes it will try another server in case of timeout), see here for more info:
Hi @tyayers Thank you for responding
Today I got to know that requirement was changed and now we needs to fallback between the endpoints and not between the hostnames.
Example:
Hostname- mocktarget.apigee.net
Endpoint- /XML and /Json
We tried with /XML and failed and now we needs to fallback to /Json.
Is there any workaround on this type of scenario?
You could do a basic version by just checking the response in the postflow, and if it failed then doing a ServiceCallout to the other /json path to try and get a response. This would work as a simple retry, but without all of the features of the full LoadBalancing options referenced above. However simple fallback handling to call a different path is possible by doing additional ServiceCallouts to try and get a valid result.