Layer7 API Management

  • 1.  Building custom Retry logic in CA API GW

    Posted Jul 14, 2017 07:46 AM

    I am trying to build a retry policy when  Route assertion fails due to unexpected momentary server/network errors. I am looking for a logic where i can  retry for a specified attempts in case of particular errors. Is this kind of logic can be built using the policy logic or is there any assertions available to achieve this? If it is possible using  the policy logic, what is the way to have the counter for retry attempts as we don't have any assertion for mathematical operations.



  • 2.  Re: Building custom Retry logic in CA API GW

    Posted Jul 14, 2017 10:40 AM

    Take a look at the 'Connection' tab of the routing assertion:

     

    this value is the number of attempts in addition to the first try, to establish a tcp connection to the routing url, which sounds like what you're looking for

     

     

    reference: https://docops.ca.com/ca-api-gateway/9-2/en/policy-assertions/assertion-palette/message-routing-assertions/route-via-http-s-assertion

     

     

    hope this helps!!



  • 3.  Re: Building custom Retry logic in CA API GW

    Posted Jul 14, 2017 01:27 PM

    Hi Doyle

    I believe this configuration only works for Timeouts(Read etc). However in case we have a scenario where CA API GW is invoking a back end service that errors out for some reason (Could be an SSL related issue etc), is there a way where we can do Retries.



  • 4.  Re: Building custom Retry logic in CA API GW
    Best Answer

    Posted Jul 15, 2017 12:43 AM

    yeah, the question mentioned server/network errors, so i just wanted to make sure the author knew this was available. The retry count is an attempt to make a tcp connection... but to your point, if the tcp connection was already made, and you receive an error for some other reason, i think the best approach would be to have an 'At Least' Folder, containing the number of retries you want to do ? As soon as any folder succeeds, you move out and continue on with the policy...



  • 5.  Re: Building custom Retry logic in CA API GW

    Posted Jul 15, 2017 12:48 AM

    Thanks Doyle. BTW wouldn't it be a good option to have this as a configurable way in the product itself based on a set of error codes that can be specified by the end user ?