All Products
Search
Document Center

Microservices Engine:Configure a traffic replication policy

Last Updated:Dec 16, 2025

You can configure a traffic replication policy for a route on a cloud-native gateway. This way, you can perform simulation tests and fault location on the system by copying traffic of online applications to a specific application. This topic describes how to configure a traffic replication policy on a cloud-native gateway.

Background information

Networks are becoming increasingly complex. As a result, simulation of online requests in a test environment becomes more difficult. To resolve this issue, the traffic replication feature is introduced. The traffic replication feature replicates online requests at the traffic ingress and sends the replica to the test environment. This allows you to test some new features or verify defects based on online traffic.

Sample scenario

In this example, a traffic replication policy is configured for Route1 to copy traffic to Service2. The replication percentage is 100%. The following figure shows the architecture in the sample scenario.

image

Configure a traffic replication policy

  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 ID of the gateway.

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

  4. Find the route for which you want to configure the traffic replication policy, and click Policies in the Actions column.

  5. On the Policies tab, click Traffic Mirror.

  6. On the Traffic Mirror tab, configure the parameters and click Determine. The following table describes the parameters.

    Parameter

    Description

    Destination Service

    The destination service to which you want to forward replicated traffic.

    Note

    Only HTTP- or HTTPS-based services are supported.

    Port Number

    The port of the destination service. You can select Dynamic Port.

    Note

    Dynamic Port is suitable for scenarios in which service ports dynamically change. You cannot select Dynamic Port for multi-port services.

    Traffic Mirror Percentage (%)

    The traffic replication percentage. Valid values: 0 to 100.

    Note

    If you set this parameter to 50, 50% of traffic in the current route is replicated to the destination service.

    Enable

    Specifies whether to enable the traffic replication policy.

Verify the result

On the Overview page of the gateway for which you configure the traffic replication policy, choose Observation Analysis > Business Monitoring > Canary Release Comparison Dashboard. View the queries per second (QPS) of Service1 and Service2. In the result, the QPS of Service1 is the same as the QPS of Service2. This indicates that all traffic of Service1 is replicated to Service2.