I want to perform quota based limitation. For each user account our add on appliation generate a unique API Key based on we need to say if this tenant has reached their limit or not say 1000 per day per tenant. We just want to use Apigee Edge for proxy and throttling.
As per my understanding we’ve to use the element with the quota policy because element does value of a variable and for every unique value of that variable it creates a seperate counter. Thats’ the reason from the ‘request header’ i’m using '‘Zapiaccesskey’ value.
Here is the request header:
request.headers
Out[1]: EnvironHeaders([('Authorization', u'JWT eyJ0eXAiciOiJIUzI1NiJ9.eyJzdWIiOiJhZG1pbiIsInFzaCI6ImZjZDU1YjIzNx5WVRwaEkRBdE9ERmxNUzFoTURFeU5HUmhNR0l5TVRZZUsImlhdCI6MTQ1NjQ4Mjc5NX0.chMhYrYob99FYc8Dv6VuHC8CLnx5-aRNTHLC2znNMrI'), ('Content-Length', u'69'), ('User-Agent', u'ZFJImporter'), ('Connection', u'Keep-Alive'), ('Host', u'192.168.200.91:5000'), ('Zapiaccesskey', u'amlyYTphOWU4YzYwZS00MzExLTRjNDAtODFaW4'), ('Content-Type', u'application/json; charset=UTF-8')])
Here is what I’ve done so far:
-
Created an Apigee Proxy
-
Attached a Quota policy
Here is the Quota Policy I created :
<?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"/>
<Identifier ref="request.header.Zapiaccesskey"/>
<Interval ref="request.header.quota_count">1</Interval>
<Distributed>true</Distributed>
<Synchronous>false</Synchronous>
<TimeUnit ref="request.header.quota_timeout">month</TimeUnit>
</Quota>
The issue what I’m seeing is that even if I try to make a request using two different API keyss still I get the below error. The strange thing is that even if I try to make request with a newly generated (3rd) API key, it throw the same “Quota Limit Exceeded” error.
Error:Unexpected response code: 500 {"fault":{"faultstring":"Rate limit quota violation. Quota limit exceeded. Identifier : ZjU3ONWUtZjY
Could someone please help me in fixing this issue.

