Endpoint Retry and Timeouts¶
When microgateway connect with upstream backend services, it might require to handle the scenarios where backend might be unavailable due to load or backend is taking lot of time to respond.
Retry Config¶
There can be certain services that are extremely important, gateway as a proxy should retry to connect to the service in case of an failure happens during the first time.
Retry config specifies how gateway retries in the event of an error when connecting with the backend. The retry parameters can be specified in the x-wso2-production-endpoint
or x-wso2-sandbox-endpoint
open API extension
x-wso2-production-endpoints:
urls:
- https://localhost:2380/v3
advanceEndpointConfig:
retryConfig:
count: 1
intervalInMillis: 1000
backOffFactor: 1.2
statusCodes:
- 504
The following are the Endpoint Retry Configurations that you can configure for both the production and sandbox endpoints.
|
Timeout Config¶
Certain services might take different amount of time to respond based on the load it is currently handling.
The Timeout config is used to gracefully handle network timeouts, which occur when used to connect upstream backend services via microgateway.
When timeoutInMillis
config is specified microgateway will wait until specified time period before closing the connection with the backend and sending the error response to the client.
The timeout parameter can also be specified in the x-wso2-production-endpoint
or x-wso2-sandbox-endpoint
open API extension.
x-wso2-production-endpoints:
urls:
- https://localhost:2380/v3
advanceEndpointConfig:
timeoutInMillis: 7000
Top