Closed dinhtrung closed 6 years ago
Add following attributes to service configuration:
File: VasCloudSmsSubmitCallable
public static Map<String, Bucket> bucketList = new ConcurrentHashMap<String, Bucket>();
VasCloudConfigurationDTO cfg = mapper.readValue(mapper.writeValueAsString(campaign.getCfg().get("VASCLOUD")), VasCloudConfigurationDTO.class);
if (cfg.getRateLimit() != null) {
Bucket svcBucket = bucketList.get(cfg.getId());
if (svcBucket == null ) {
svcBucket = createBucket(cfg.getRateLimit());
bucketList.put(cfg.getId(), svcBucket);
}
svcBucket.asScheduler().consume(smsList.size());
}
createBucket(campaign.getRateLimit());
Allow customer to add global rate limit per VASCloud service, along with ratelimit per campaign