Apigee forces a 'count' default of zero in Quota policy - isn't it optional? How do I get around it?

Not applicable

I have a Quota policy in which I define the count, Interval and TimeUnit with a countRef to the product. I did not assign a default 'count' attribute in the Allow tag because some products apply a rate limit and others do not. However, when the policy is uploaded to Apigee a default count is zero is applied. Is this a bug or a feature? How do I get around it - set an absurdly high default 'count' value?

1 1 137
1 REPLY 1

Hi @Jaye Jarchow,

As per the documentation of Quota policy the default value of count is 2000.

If you have different products with different quota limits then do a complete dynamic quota policy with reading values for Interval, TimeUnit, and Allow count/countRef from product entity.

If you have VerifyAPIKey policy in your proxy then you can fetch all these details from flow variables like:

verifyapikey.{policy_name}.apiproduct.developer.quota.limit

verifyapikey.{policy_name}.apiproduct.developer.quota.interval

verifyapikey.{policy_name}.apiproduct.developer.quota.timeunit

Else if you have oAuth token validation policy in proxy then these details are available in :

apiproduct.developer.quota.timeunit

apiproduct.developer.quota.interval

apiproduct.developer.quota.limit

Setting a large values for count and small timeunit may not be a concrete solution and may fail sometime.

For products that don't have quota restrictions you can set a custom attribute like no_quota and escape the quota policy with the condition:

<Condition>( apiproduct.no_quota != true)</Condition>

Set no_quota to true for products that don't require quota restrictions.

Please check the docs for Verify API Key, OAuth V2 and Quota policy for flow variables details.

Hope this helps!