这是一个4MB/s
政策。
@Plan:name('carbon.super_app_BandwidthPolicy')
@Plan:description('ExecutionPlan for app_BandwidthPolicy')
@Import('org.wso2.throttle.processed.request.stream:1.0.0')
define stream RequestStream (messageID string, appKey string, appTier string, subscriptionKey string, apiKey string, apiTier string, subscriptionTier string, resourceKey string, resourceTier string, userId string, apiContext string, apiVersion string, appTenant string, apiTenant string, appId string, apiName string, propertiesMap string);
@Export('org.wso2.throttle.globalThrottle.stream:1.0.0')
define stream GlobalThrottleStream (throttleKey string, isThrottled bool, expiryTimeStamp long);
FROM RequestStream
SELECT messageID, (appTenant == 'carbon.super' and appTier == 'BandwidthPolicy') AS isEligible, appKey AS throttleKey, propertiesMap
INSERT INTO EligibilityStream;
FROM EligibilityStream[isEligible==true]#throttler:timeBatch(1 min, 0)
select throttleKey, (sum(cast(map:get(propertiesMap,'messageSize'),'long')) >= 4194304) as isThrottled, expiryTimeStamp group by throttleKey
INSERT ALL EVENTS into ResultStream;
from ResultStream#throttler:emitOnStateChange(throttleKey, isThrottled)
select *
insert into GlobalThrottleStream;
来源
2016-09-29 11:56:14
Bee
您是否使用默认高级遏制? – Bee
在发布API时,我已经设置了这个... 高级限制策略:我已经选择了“应用于API级别”,并从下拉菜单中将该值设置为“Unlimited”。 – siddhesh
如果您正确创建了新的订阅策略(每分钟20个),它应该按预期进行调节。你可以在'wso2am-2.0.0/repository/deployment/server/executionplans'中发布相应的策略文件吗? – Bee