Monday, October 5, 2020

SAP API Management - Quota Policy - Rolling Window Type

  Scenario: You want to activate quota policy using rolling window type. In this case, counter will not be reset after particular interval of time.

Steps:

1. Add an instance of Quota in Preflow for incoming request.


2. Modify the code as per requirement.

Code (Allow 2 calls/3min. It will always check last 3 minutes before allowing the call. )

<Quota async="false" continueOnError="false" enabled="true" type="rollingwindow" xmlns="http://www.sap.com/apimgmt">

  <Allow count="2"/>

  <Interval>3</Interval>

<Distributed>true</Distributed>

<Synchronous>true</Synchronous>

  <TimeUnit>minute</TimeUnit>

</Quota>

3. Test the API. 



No comments:

Post a Comment