All Products
Search
Document Center

Microservices Engine:Configure a timeout policy

Last Updated:Apr 07, 2024

Cloud-native gateways allow you to configure timeout policies at the route level. In timeout policies, you can specify the maximum period of time in which your gateway waits for responses to requests for a specified route based on your business requirements. If the gateway does not receive a response from the backend service within the specified period of time, the gateway returns the 504 (Gateway Timeout) status code to the client. This topic describes how to configure a route timeout policy for a cloud-native gateway.

Procedure

  1. Log on to the MSE console. In the top navigation bar, select a region.

  2. In the left-side navigation pane, choose Cloud-native Gateway > Gateways. On the Gateways page, click the name of the gateway.

  3. In the left-side navigation pane, click Routes, and click the Routes tab.

  4. Find the routing rule that you want to modify, and click Policies in the Actions column.

  5. On the Policies tab, click Timeout.

  6. In the Timeout section, configure the parameters and click Save.

    Parameter

    Description

    Timeout Period

    The timeout period for the current route. Unit: seconds.

    Note

    If you set this parameter to 0 or keep the timeout policy disabled, the gateway waits for responses all the time.

    Enable

    Specifies whether to enable the timeout policy.

    • If you turn on the switch, the timeout policy takes effect.

    • If you turn off the switch, the timeout policy does not take effect.

    After the timeout policy is created and enabled, you can check whether the timeout policy takes effect based on your business requirements.