Skip to content

Latest commit

 

History

History
68 lines (47 loc) · 2.75 KB

File metadata and controls

68 lines (47 loc) · 2.75 KB
description
This page provides the technical details of the Traffic Shadowing policy

Traffic Shadowing

Overview

Traffic shadowing allows to asynchronously copy the traffic to another service. By using this policy, the requests are duplicated and sent to the target. The target is an endpoint defined at the API level. The request can be enriched with additional headers.

Functional and implementation information for the traffic-shadowing policy is organized into the following sections:

Examples

{% hint style="warning" %} This policy can only be applied to v2 APIs. It cannot be applied to v4 message APIs or v4 proxy APIs. {% endhint %}

{% tabs %} {% tab title="Proxy API example" %} Sample policy configuration:

{
  "traffic-shadowing": {
    "target": "{#endpoints['target-endpoint']}",
    "headers": [
        {
            "name": "X-Gravitee-Request-Id",
            "value": "{#request.id}"
        }
    ]
  }
}

{% endtab %} {% endtabs %}

Configuration

Phases

The phases checked below are supported by the traffic-shadowing policy:

v2 PhasesCompatible?v4 PhasesCompatible?
onRequesttrueonRequestfalse
onResponsefalseonResponsefalse
onRequestContentfalseonMessageRequestfalse
onResponseContentfalseonMessageResponsefalse

Options

The traffic-shadowing policy can be configured with the following options:

PropertyRequiredDescriptionDefaultExample
targettrueThe target endpoint (supports EL).-{#endpoints['my-endpoint']}
headersfalseA list of HTTP headers.--

Compatibility matrix

The following is the compatibility matrix for APIM and the traffic-shadowing policy:

Plugin version Supported APIM versions
2.x and upper 3.18.20, 3.19.9, 3.20.3 and upper.

Changelogs

{% @github-files/github-code-block url="https://github.com/gravitee-io/gravitee-policy-traffic-shadowing/blob/master/CHANGELOG.md" %}