I am new to Azure API management. We are calling an external web api from Azure API management. If the web api is not able to communicate with the Azure API management, we are trying for a couple of retry before give up.
We have added a retry policy in the outbound node (policy) to check the response status of the backend node (policy). If the response status is other than 200 then we are trying to call the web api again after 10 seconds. We want to give 2 try before give up.
The problem is outbound node (policy) always execute send-request node (policy), even we just write
<retry condition="@(false)" count="2" interval="10" first-fast-
retry="false">
<send-request.....>
......
......
</send-request>
</retry>
How to write a condition in the retry policy so that it will get checked before executing the child nodes.
<outbound>
<base />
<retry condition="@(context.Response.StatusCode != 200)" count="2" interval="10" first-fast-retry="false">
<send-request mode="new" response-variable-name="responseVar" ignore-error="false">
<set-url>... </set-url>
<set-method>POST</set-method>
<set-body>...</set-body>
<set-header>...</set-header>
</retry>
</outbound>