Resetting the quota in the product level if the response codes are other then 2xx.

I have added the quota in the product level. I have to make sure that the quota to be executed only for success response from the backend i.e., for 2xx. If I get the codes other than 2xx, I want to reset the quota for that particular count. For e.g., if my available count is 10 and If I make a call and get error code from the back end, for the next try the count should be 10 only and not 9. 

I prefer the solution for Apigee x/hybrid.

Please help on this.

0 1 40
1 REPLY 1

Hello @jnaneshgowda320 ,

You have to keep quota policy in Target response flow instead of keeping it in entry point of the proxy request execution. And make a condition for the quota policy to execute if the status code is equals 200.  By making this your quota counter won't be increased in case any other status codes you received from the target.

 

<Condition>(response.status.code = 200)</Condition>