A cloud-native gateway lets you configure a route-level retry policy to automatically retry failed requests. You can specify retry triggers, such as connection failures, an unavailable backend service, or responses with specific HTTP status codes.
Route retry conditions
If a backend service returns a 5xx error, the cloud-native gateway automatically retries the request up to the configured number of times.

-
The following retry conditions are available for the HTTP protocol:
-
5xx: The cloud-native gateway retries the request if the backend service returns a
5xxresponse, or if a disconnection, reset, or read timeout occurs.NoteThe
5xxcondition includes theconnect-failureandrefused-streamconditions. -
reset: The cloud-native gateway retries the request if a disconnection, reset, or read timeout occurs.
-
connect-failure: The cloud-native gateway retries the request if it fails due to a connection failure.
-
refused-stream: The cloud-native gateway retries the request if the backend service resets the stream with a
REFUSED_STREAMerror code. -
retriable-status-codes: The cloud-native gateway retries the request if the response's HTTP status code matches a specified retry status code.
NoteYou can specify retry status codes only if
retriable-status-codesis selected as a retry condition.
-
-
The following retry conditions are available for the gRPC protocol:
-
cancelled: The cloud-native gateway retries the request if the gRPC status code in the response header is
cancelled. -
deadline-exceeded: The cloud-native gateway retries the request if the gRPC status code in the response header is
deadline-exceeded. -
internal: The cloud-native gateway retries the request if the gRPC status code in the response header is
internal. -
resource-exhausted: The cloud-native gateway retries the request if the gRPC status code in the response header is
resource-exhausted. -
unavailable: The cloud-native gateway retries the request if the gRPC status code in the response header is
unavailable.
-
Configure a route retry policy
-
Log on to the MSE console. In the top navigation bar, select a region.
-
In the left-side navigation pane, choose Cloud-native Gateway > Gateways. On the Gateways page, click the ID of the gateway.
-
In the left-side navigation pane, click Routes. Then, click the Routes tab.
-
Find the desired route and click Policies in the Actions column.
-
On the Policies page, click Retry.
-
On the Retry panel, configure the parameters and click Save.
Parameter
Description
Retry Times
The maximum number of times a failed request is retried. The value must be an integer from 0 to 10. A value of 2 or less is recommended.
NoteA value of 0 disables retries.
Retry Condition
The conditions that trigger a request retry. You can select one or more conditions. For details, see Route retry conditions.
Retry Status Code
The HTTP status codes that trigger a retry. You can specify one or more codes.
NoteTo configure the Retry Status Code, you must specify
retriable-status-codesfor the Retry Condition.Enable
Enables or disables the route retry policy.
-
Enable: The route retry policy is active.
-
Disable: The route retry policy is inactive.
NoteIf this policy is disabled, the gateway uses a default retry configuration. The default configuration retries a request up to two times for the following conditions:
connect-failure,refused-stream,unavailable,cancelled, andretriable-status-codes.After you configure and enable the retry policy, verify that it functions as expected.
-