Simple Throttling Filter in Structured Editor
This section describes how to set up a simple throttling filter in the structured editor of Studio. For more information about how to set up throttling, see "Configuring Simple Throttling".
In IG Studio, create a route:
Go to http://openig.example.com:8080/openig/studio, and select Create a route.
Select Structured to use the structured editor.
Select Advanced options on the right, and create a route with the following options:
Base URI:
http://app.example.com:8081
Condition: Path:
/home/throttle-simple
Name:
00-throttle-simple
Select and enable Throttling.
In GROUPING POLICY, apply the rate to a single group.
All requests are grouped together, and the default throttling rate is applied to the group. By default, no more than 100 requests can access the sample application each second.
In RATE POLICY, select Fixed, and allow 6 requests each 10 seconds.
On the top-right of the screen, select and Display to review the route.
The following route should be displayed:
{ "name": "00-throttle-simple", "baseURI": "http://app.example.com:8081", "condition": "${matches(request.uri.path, '^/home/throttle-simple')}", "handler": { "type": "Chain", "config": { "filters": [ { "type": "ThrottlingFilter", "name": "ThrottlingFilter-1", "config": { "requestGroupingPolicy": "", "rate": { "numberOfRequests": 6, "duration": "10 s" } } } ], "handler": "ReverseProxyHandler" } } }
Select Deploy to push the route to the IG configuration.
You can check the
$HOME/.openig/config/routes
folder to see that the route is there.