Cloud-native API Gateway supports route-level retry policies that automatically retry failed requests. Retry conditions include connection failures, unavailable backend services, and specific HTTP status codes.
Route retry conditions
When a backend service returns a 5xx error, Cloud-native API Gateway retries the request based on the configured retry count.
-
HTTP retry conditions:
-
5xx: Retries on any
5xxresponse, connection disconnect, reset, or read timeout.NoteThe
5xxcondition includes theconnect-failureandrefused-streamconditions. -
reset: Retries on connection disconnect, reset, or read timeout.
-
connect-failure: Retries on connection failure.
-
refused-stream: Retries when the backend resets a stream with the
REFUSED_STREAMerror code. -
retriable-status-codes: Retries when the backend response matches a specified HTTP status code.
NoteTo retry on specific status codes, select
retriable-status-codes.
-
-
gRPC retry conditions:
-
cancelled: Retries when the backend returns a
cancelledgRPC status. -
deadline-exceeded: Retries when the backend returns a
deadline-exceededgRPC status. -
internal: Retries when the backend returns an
internalgRPC status. -
resource-exhausted: Retries when the backend returns a
resource-exhaustedgRPC status. -
unavailable: Retries when the backend returns an
unavailablegRPC status.
-
Configure a route retry policy
-
Choose a tab based on whether the API is inside or outside a gateway instance.
API outside an instance
-
Log in to the Cloud-native API Gateway console. In the left-side navigation pane, choose API and select a region.
-
Click the target API. From the drop-down list, select the target instance, or select All instances.

-
Select the target route from the Routes.
API inside an instance
-
Log in to the Cloud-native API Gateway console. In the left-side navigation pane, choose Instance, and select a region.
-
On the Instance page, click the target gateway instance ID. In the left-side navigation pane, choose API and click the target API.
-
Select the target route from the Routes.
-
-
Click the Configure Policy tab. In the Inbound Processing section, click Enable Policy/Plug-in.
-
Click the Retry card. In the Add Policy: Retry panel, configure the parameters and click Add.
NoteAfter you enable the retry policy, verify that it works as expected.
Parameter
Description
Enable
Enables or disables the retry policy.
-
Enabled: The policy is active.
-
Disabled: The policy is inactive.
NoteWhen disabled, the gateway applies a default retry configuration: maximum 2 attempts with conditions
connect-failure,refused-stream,unavailable,cancelled, andretriable-status-codes.Retry Times
Maximum retry attempts for a failed request. Valid values: 0 to 10 (integer). Recommended: 2 or less.
NoteSetting the value to 0 disables retries.
Retry Condition
Select one or more retry conditions from the Route retry conditions list.
Retry Status Code
HTTP status codes that trigger a retry. You can enter multiple values.
NoteYou can configure Retry Condition only if
retriable-status-codesis selected as a Retry Status Code. -