Dear Team,
I have added 2 extra fields in Rate limiting Policy, as shown in the below image.
These extra fields are added because I need it in response header in success(200) as well
as failure(429) responses.
To do so I have modified below mentioned files,
1. rate-limiting.include
<div>
<span>I want to set retry time to</span>
<input id="time-limit" ng-model="config.retryTime"
class="form-control inline-apiman-form-control form-control" style="width:
100px" type="text"
apiman-i18n-key="rate-limiting.enter-num-requests" placeholder="Time
limit" ng-disabled="isEntityDisabled()"></input>
<select id="retryTimeUnit" ng-model="config.retryTimeUnit"
apiman-select-picker="" data-field="retryTimeUnit"
class="selectpicker inline-line apiman-inline-form-dropdown"
data-style="btn-default apiman-inline-form-dropdown" style="width:
100px" ng-disabled="isEntityDisabled()">
<option value="Second" data-content="<span
class='apiman-label-faded'>Second</span>"
apiman-i18n-key="rate-limiting.second">Second</option>
<option value="Minute"
apiman-i18n-key="rate-limiting.minute">Minute</option>
<option value="Hour"
apiman-i18n-key="rate-limiting.hour">Hour</option>
<option value="Day"
apiman-i18n-key="rate-limiting.day">Day</option>
<option value="Month"
apiman-i18n-key="rate-limiting.month">Month</option>
<option value="Year"
apiman-i18n-key="rate-limiting.year">Year</option>
</select>
</div>
2. RateLimitingConfig
private long retryTime;
private RateLimitingPeriod retryTimeUnit;
-- getter , setters
3. RateLimitingPolicy
responseHeaders.put("X-Retry-Time", timeLimit);
Kindly Confirm,
- Where are we storing these information ? In Elastic Search, in SQL or
somewhere else ?
- Will these changes make any impact on other components ?
- Would you recommend this code change ?
Kindly suggest if you have any other solution for similar requirement.
[cid:image001.png@01D26DC5.2691F410]
Regards,
Ram Tanna
9819002243
"Confidentiality Warning: This message and any attachments are intended only for the
use of the intended recipient(s).
are confidential and may be privileged. If you are not the intended recipient. you are
hereby notified that any
review. re-transmission. conversion to hard copy. copying. circulation or other use of
this message and any attachments is
strictly prohibited. If you are not the intended recipient. please notify the sender
immediately by return email.
and delete this message and any attachments from your system.
Virus Warning: Although the company has taken reasonable precautions to ensure no viruses
are present in this email.
The company cannot accept responsibility for any loss or damage arising from the use of
this email or attachment."