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

Ram.Tanna at ril.com Ram.Tanna at ril.com
Mon Jan 16 01:51:48 EST 2017


Thank you team for the inputs.

Hi Eric,

Retry-Time response header Use case :

The application which we are developing has millions of users.

We needed an option to down the API for certain amount of time at runtime. Let’s say If my API is not working as required due to high load (or any other reason), admin should have option to provide a downtime on that particular API.

The downtime period should be dynamic. It could be anything 15 min / 30 min/ 1 hour…..

If admin is setting it as 15 min then clients will be able to see appropriate message as “The operation which you are trying to perform is under maintenance, please try after 15/30 mins (or please try at 1:15 AM/PM). ”

Hi Marc,

X-Retry-Time: 1800  :- The value is set by the admin while configuring the policy. If admin is setting it as 30 mins then response would be X-Retry-Time: 1800. It is converted into seconds and stored.


Dear Team,

I have a file upload feature in my application. Just want to understand If client uploads a file, then does apiman store it or its bytes in temp folder or anywhere else ? Or Apiman doesn’t care about the uploaded file and just forwards the request to end API.


I have a file upload feature in my application.
Just want to understand,
If client uploads a file then, does apiman store the file(or bytes) in temp folder or somewhere else ? Or Apiman don’t care about the uploaded file and just forwards the request to end API.


Regards,
Ram Tanna
9819002243

From: Eric Wittmann [mailto:eric.wittmann at redhat.com]
Sent: 13 January 2017 19:11
To: Marc Savy <marc.savy at redhat.com>
Cc: Ram Tanna <Ram.Tanna at ril.com>; ram_tanna3 at yahoo.co.in; apiman-user at lists.jboss.org
Subject: Re: [Apiman-user] Impact of adding extra fields in Rate Limiting Policy

+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<mailto: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<mailto: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.







[cid:image001.png at 01D26FEB.D65BBDE0]
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<mailto:Apiman-user at lists.jboss.org>
https://lists.jboss.org/mailman/listinfo/apiman-user


_______________________________________________
Apiman-user mailing list
Apiman-user at lists.jboss.org<mailto:Apiman-user at lists.jboss.org>
https://lists.jboss.org/mailman/listinfo/apiman-user

"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."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/apiman-user/attachments/20170116/74bebb78/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 62442 bytes
Desc: image001.png
Url : http://lists.jboss.org/pipermail/apiman-user/attachments/20170116/74bebb78/attachment-0001.png 


More information about the Apiman-user mailing list