13
APPLY RATE LIMITING SLA POLICY WITH MULESOFT API GATEWAY Vince Jason Soliza

Rate Limiting - SLA Based Policy

Embed Size (px)

Citation preview

Page 1: Rate Limiting - SLA Based Policy

APPLY RATE LIMITING SLA POLICY

WITH MULESOFT API GATEWAYVince Jason Soliza

Page 3: Rate Limiting - SLA Based Policy

Apply Rate Limiting – SLA Based Policy in API ManagerThis presentation will show how to apply Rate Limiting – SLA Based Policy in API Gateway using Anypoint Platform for APIs

Page 4: Rate Limiting - SLA Based Policy

Run in Anypoint Studio• Run the api application in anypoint studio

Page 5: Rate Limiting - SLA Based Policy

Apply Rate Limiting – SLA Based Policy• Login to anypoint platform and open the API Manager where we want to

apply the policy

• Click the Policies tab in the bottom part of the API Manager

Page 6: Rate Limiting - SLA Based Policy

Apply Rate Limiting – SLA Based Policy• We can view the list of applied and currently available policies within the

API. Currently we have no applied policies.

• Look for the Rate Limiting – SLA Based policy then click Apply

Page 7: Rate Limiting - SLA Based Policy

Create SLA• If there’s no SLA tiers defined in the API, a prompt occur with a message

saying SLA has to be created first before applying the policy. It contains the link where to create SLA in the API Manager. Alternately there’s a tab where SLAs can be defined.

• Click add SLA tier. The SLA example in the right has a limit of 10 requests/second. The API access requests for this SLA will be granted without the need of approval.

Page 8: Rate Limiting - SLA Based Policy

Create SLA• We have created 3 SLA tiers, each has different rate limits. Request for

access in Silver and Gold SLAs requires approval.

• Now we have SLAs, let’s proceed in creating applications. On the API Manager main page. Click Create Portal, We doesn’tneed to edit the portal contents at the moment.• Click live portal in the upper right corner.In the live portal, click request API access also in the upper right.• Add new application.

Page 9: Rate Limiting - SLA Based Policy

Create Application• Now let’s match application withSLA and click Request for API access.• The request will be automatically approved as configured in the SLA.• Applications are assigned withcliend_id & client_secret this is used toidentify the application doing the certainRequest.• Proceed to applying theRate Limiting – SLA Based Policy.• Click apply, the form in the right will be shown. • Extracting client_id &client_secret from the request isconfigured with MEL expression in this form .

Page 10: Rate Limiting - SLA Based Policy

Grant API access requests• Silver and Gold applications are still pending for approval, the API owner

can approve the request.

Page 11: Rate Limiting - SLA Based Policy

Test the Policy• Open the application details listed in DeveloperPortal. Get the client_id & client_secret.• Open SOAPUI and make request for each applications having their unique

client_id and client_secret.

• See the rate limit response properties, it coincides with the specified limit of the application’s SLA tier.

Page 12: Rate Limiting - SLA Based Policy

Summary

• This is how to define SLA tiers for your API version in the Anypoint Platform for APIs.

• To enforce SLA tiers, you need to apply a rate-limiting or throttling policy that is SLA-based.

• SLA based policies require all applications to register for access to a specific tier, passing client credentials is required to identify the application doing the requests.

• The additional response headers are used to inform users about the SLA restrictions and the remaining spare capacity that the SLA allows.

Page 13: Rate Limiting - SLA Based Policy

QUESTIONS?Please leave a comment