hi,
I have implemented the quota policy and wanted to know how can do a fraction of the overall api quotalimit:
I used below in quota po!icy and it is not working.
<Allow count="10" countRef="(verifyapikey.VerifyAPI-KEY.apiproduct.developer.quota.limit)/10" />
How can we achieve this?
Hi Renuka Renikunta,
You can use Messageweight to increase impact of request messages.
you can not use countref(like/10)
Use Javascript policy before the quota policy to set a custom variable called messageWeight based on the request type. In your case the weight needs to be set to 0.1.
Refer the below quota policy code:
<?xml version="1.0" encoding="UTF-8"standalone="yes"?> <Quota async="false" continueOnError="false" enabled="true" name="Quota-1"> <DisplayName>Quota-1</DisplayName> <Properties/> <Allow count="10"/> <Interval>1</Interval> <Distributed>true</Distributed> <Synchronous>true</Synchronous> <TimeUnit>minute</TimeUnit> <MessageWeight ref="messageWeight"/> </Quota>
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |