Rate Limit Action
In this blog , we will learn about Rate Limit Action in IBM API Connect.
The purpose of this document is to provide a Brief understanding of how rate limit action is applied with-in API Flow.
Apply the limit policy in your API assembly to set restrictions on the frequency of API calls. Rate and burst limits control the number of requests within a defined timeframe.
There are four ways by which we can apply the limit with-in the flow, they are:
- Catalog by Name
- Plan by Name
- Gateway by Name
- Plan Default
Catalog by Name:
The specified rate or burst limits are configured within the corresponding API collection object on the DataPower API Gateway. This object serves as the representation of your API Connect Catalog in the gateway configuration.
Note: This rate limit/burst limit/count limit can be created in the API collection by selecting the specified catalog and add the rate limit/burst limit/count limit in limits tab.
Plan by Name:
Apply the limits as assembly burst or assembly count limits, which are specifically set within the subscribed Plan associated with the calling application.
Gateway by Name:
The DataPower API Gateway’s apig w object, apiconnect, defines the boundaries that must be adhered to.
Plan Default:
When the Plan Default is applied with-in the Assembly flow then the plan that is specified the product to which the particular API is published is applied to the flow automatically.
Applying Rate limit in Assembly:
For applying the limit policy to the API with-in the flow we should add the Limit node and configure it accordingly.
Here I have taken the source as plan by name, which means I am using a rate limit/burst limit/count limit that is specified in the product plan.
In the designed flow only “/ratelimit” operation is effected with the ratelimit that is specified with in the limit Action and “/non-ratelimit” operation will be effected with the ratelimit that is specified in the Product Plan.
API Flow:
Testing:
Here the Burst Limit specified as 2calls/1minute