How can I implement a quota based on message volume?

I would like to impose a message volume quota rather than just message count.

For example, one

GET /reports?limit=100 

should be equivalent to ten

GET /reports?limit=10

I suppose I could merely assign limit to <MessageWeight ref="request.queryparam.limit"/>.

Or I could set use the Content-Length header <MessageWeight ref="response.header.content-length">.

Anyone have any practical experience before I start experimenting?

0 2 143
2 REPLIES 2

@Kurt Kanaskie , Yes, <MessageWeight ref="request.queryparam.limit"/>. should work. Am i missing something ?

4MV4D video that explains same here, https://www.youtube.com/watch?v=QyiN1R5dqPE

The following policy allows 1 Meg per 1 minute per app:

<Quota async="false" continueOnError="false" enabled="true" name="QuotaMessageVolume" type="flexi">
    <DisplayName>QuotaMessageVolume</DisplayName>
    <Identifier ref="apigee.client_id"/>
    <Allow count="1000000"/>
    <Interval>1</Interval>
    <TimeUnit>minute</TimeUnit>
    <Distributed>true</Distributed>
    <Synchronous>true</Synchronous>
    <MessageWeight ref="response.header.content-length"/>
</Quota>

Max value for count is: 9223372036854775807