Skip to content

Latest commit

 

History

History
92 lines (66 loc) · 2.08 KB

README.adoc

File metadata and controls

92 lines (66 loc) · 2.08 KB

Latency policy

Gravitee.io License Releases CircleCI

Compatibility with APIM

Plugin version APIM version

Up to 1.3.x

Up to 3.9.x

1.4.x

Up to 3.20

2.x

4.x to latest

V3 engine

onRequest onResponse onRequestContent onResponseContent

X

V4 engine

onRequest onResponse onMessageRequest onMessageResponse

X

X

X

Description

You can use the latency policy to add latency to either the request or the response. So for example, if you configure the policy on the request with a latency of 100ms, the gateway waits 100ms before routing the request to the backend service.

This policy is particularly useful in two scenarios:

  • Testing: adding latency allows you to test client applications when APIs are slow to respond.

  • Monetization: a longer latency can be added to free plans to encourage clients to move to a better (or paid) plan.

== Configuration

You can configure the policy with the following options:

|Property |Required |Description |Type| Default

^|time

.| |Time to wait (ms) .|integer .|100

^|timeUnit

.| |Time unit ( "MILLISECONDS" or "SECONDS") .|string .|"MILLISECONDS"

== Errors

== HTTP status code

|Code |Message

^| 500

| Server error