{ Community }
  • Academy
  • Docs
  • Developers
  • Resources
    • Community Articles
    • Apigee on GitHub
    • Code Samples
    • Videos & eBooks
    • Accelerator Methodology
  • Support
  • Ask a Question
  • Spaces
    • Product Announcements
    • General
    • Edge/API Management
    • Developer Portal (Drupal-based)
    • Developer Portal (Integrated)
    • API Design
    • APIM on Istio
    • Extensions
    • Business of APIs
    • Academy/Certification
    • Analytics
    • Events
    • Hybrid
    • Integration (AWS, PCF, Etc.)
    • Microgateway
    • Monetization
    • Private Cloud Deployment
    • Insights
    • IoT Apigee Link
    • BaaS/Usergrid
    • BaaS Transition/Migration
    • Apigee-127
    • New Customers
    • Topics
    • Questions
    • Articles
    • Ideas
    • Leaderboard
    • Badges
  • Log in
  • Sign up

Get answers, ideas, and support from the Apigee Community

  • Home /
  • General /
avatar image
0
Question by Shanish kp · Nov 30, 2017 at 04:35 AM · 231 Views spike arrest policy

How to make count as configurable in Spike Arrest

Hi

Is there any way we can give reference variable for count in spike arrest policy?

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<SpikeArrest async="false" continueOnError="false" enabled="true" name="Spike-Arrest-2"> <DisplayName>Spike Arrest-2</DisplayName>

<Properties/> <Identifier ref="request.header.some-header-name"/>

<MessageWeight ref="request.header.weight"/>

<Rate>30ps</Rate> </SpikeArrest>

My requirement is , this count need to be configurable like from KVM .

I can achieve this in Quota policy , but the issue is I can give unit minimum in minutes . Requirement is 5 trx / sec and if in case 6th trx in sec it should give error . I have given as 300 per minute , but there will be chance 10 trx can come in first second itself , which is exceeding 5 trx /sec .

Is this I can achieve only via Spike arrest (because if i give 300 pm , then it will divide 5 per sec ) ? If yes how I can make count as configurable ?

Or

Is there any way I can achieve this by quota? ie per second transaction.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<Quota async="false" continueOnError="false" enabled="true" name="PartnerRateLimit"> <DisplayName>PartnerRateLimit</DisplayName>

<Properties/> <Allow countRef="partnerRateLimitCount"/>

<Interval ref="request.header.quota_count">1</Interval>

<Distributed>true</Distributed>

<Synchronous>true</Synchronous>

<TimeUnit ref="request.header.quota_timeout">minute</TimeUnit>

<Identifier ref="company.name"/>

</Quota>

Comment
Add comment
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Close

2 Answers

  • Sort: 
avatar image
0

Answer by AMAR DEVEGOWDA · Nov 30, 2017 at 05:12 AM

@Shanish kp

You can set the "Rate" element in Spike Arrest policy using a variable. Refer to Samples section and "Rate" element in Spike Arrest policy documentation for more details.

Here's the sample on how you can use the variable for the Rate element for your reference:

<SpikeArrest name="SpikeArrest">
  <Rate ref="request.header.rate" />
</SpikeArrest>

The variable value must be in the form of {int}pm or {int}ps.

Also do refer to Comparing Quota, Spike Arrest, and Concurrent Rate Limit Policies documentation. It would help you to understand and choose the right/best policy based on your requirements.

Comment
Add comment · Link
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Muhammad Imran Khan   · Nov 30, 2017 at 06:00 AM

Hi Shanish kp

If there will be a chance of 10 transactions can come in first second itself than it is not possible either using quota or spike arrest. However, you can create your own custom logic using javascript.

Comment
Add comment · Link
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Follow this Question

Answers Answers and Comments

33 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

What are the maximum values of spike arrest and quota? 1 Answer

How to restrict calls to Backend based on Access Token 2 Answers

"Punish" with SpikeArrest? 1 Answer

How to does Quota and Spike Arrest policy work when in a shared flow?. 1 Answer

Spike Arrest retry time to be calculated to convey user 1 Answer

  • Products
    • Edge - APIs
    • Insights - Big Data
    • Plans
  • Developers
    • Overview
    • Documentation
  • Resources
    • Overview
    • Blog
    • Apigee Institute
    • Academy
    • Documentation
  • Company
    • Overview
    • Press
    • Customers
    • Partners
    • Team
    • Events
    • Careers
    • Contact Us
  • Support
    • Support Overview
    • Documentation
    • Status
    • Edge Support Portal
    • Privacy Policy
    • Terms & Conditions
© 2019 Apigee Corp. All rights reserved. - Apigee Community Terms of Use - Powered by AnswerHub
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Post an idea
  • Spaces
  • Product Announcements
  • General
  • Edge/API Management
  • Developer Portal (Drupal-based)
  • Developer Portal (Integrated)
  • API Design
  • APIM on Istio
  • Extensions
  • Business of APIs
  • Academy/Certification
  • Analytics
  • Events
  • Hybrid
  • Integration (AWS, PCF, Etc.)
  • Microgateway
  • Monetization
  • Private Cloud Deployment
  • Insights
  • IoT Apigee Link
  • BaaS/Usergrid
  • BaaS Transition/Migration
  • Apigee-127
  • New Customers
  • Explore
  • Topics
  • Questions
  • Articles
  • Ideas
  • Members
  • Badges