[Apiman-user] Impact of adding extra fields in Rate Limiting Policy

Eric Wittmann eric.wittmann at redhat.com
Fri Jan 13 08:41:01 EST 2017


+1 to what Marc has already said.  Note that unless you have changed the
apiman config, the manager stores data in an H2 sql database and the
gateway stores config in elasticsearch.  These settings can be changed, but
when you download the quickstart distribution those are the default
settings.

Also note that in both cases the configuration information is stored as a
JSON blob - so you do NOT need to make any backend storage changes in order
to accommodate this new configuration setting.

Could you perhaps briefly explain the use-case for the Retry-Time response
header?  If it makes enough sense it would be great to pull these changes
into the main repository.

-Eric

On Fri, Jan 13, 2017 at 8:33 AM, Marc Savy <marc.savy at redhat.com> wrote:

> Hi,
>
> Just to understand:
>
> All you display in this header is a fixed value of, for instance,
> X-Retry-Time: 50000 - it's not a calculated value?
>
> If so, then assuming things are wired up correctly this should work fine.
>
> Apiman is split into two parts, the manager and the gateway, which have
> *separate* data-stores for typical decoupling reasons (performance,
> reliability, etc).
>
> - Before publishing config will be in the manager only.
> - After publishing config will be in the manager and gateway.
>
> So, if your manager uses ElasticSearch the config will be in the
> ElasticSearch.  If your gateway the config will also be in ElasticSearch
> but a different "region". However one could be Infinispan and another
> ElasticSearch.
>
> Regards,
> Marc
>
> On 13 January 2017 at 12:54, <Ram.Tanna at ril.com> wrote:
>
>>
>>
>> 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.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> 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."
>>
>> _______________________________________________
>> Apiman-user mailing list
>> Apiman-user at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/apiman-user
>>
>>
>
> _______________________________________________
> Apiman-user mailing list
> Apiman-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/apiman-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/apiman-user/attachments/20170113/4e986226/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 62442 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/apiman-user/attachments/20170113/4e986226/attachment-0001.png 


More information about the Apiman-user mailing list