Monday, October 5, 2020

SAP API Management - Quota Policy - Flexi Type

Scenario: You want to start the counter for the Quota policy when the 1st request is received.

Steps:

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


2. Modify the code as per requirement.

Code (Allow 2 calls/1 min.)

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

  <Allow count="2"/>

  <Interval>1</Interval>

<Distributed>true</Distributed>

<Synchronous>true</Synchronous>

  <TimeUnit>minute</TimeUnit>

</Quota>

3. Test the API. 



No comments:

Post a Comment