We have this requirement to retry using a service call if we receive a non-http 200 status response but non-http 5xx.
Here are context of what we are trying to achieve so far.
-
Only use service callout when calling a service.(Reason behind is in one flow we have multiple endpoints to call which each callout should have a retry of its own).
-
If service callout receives a specific http status code we do a retry. (e.g. HTTP 405)
-
Retry to be configured only on callout as we may change the retry counter in the future.
-
We do not resort to JavaScript as we wanted to utilized the service callout loadbalancing function.
Here some of the things we already tried so far.
-
Added true tagged in the Service Callout HTTPTargetConnection and added 2 in load balancer with 2 and . When tested “real” server returns error or connection error no retry was seen on trace and further more it did not even try the “mock” server.
-
Added true tagged in the Service Callout HTTPTargetConnection and added 2 in load balancer with 2 and with mock set as true . When tested “real” with non http 200 response the “mock” will not be called but, when tested with “real” as unreachable host “mock” will only be then called. Note that trace do not show a retry happened but, it just resolve to “mock” when checking the callout trace.