Error code that Spike arrest policy returns by Apigee

As per below mentioned Apigee Docs spike arrest returns error code 429 once rate limit is exceeded(as per calculation performed by Apigee) but when we are testing getting 500 error code. Can any body suggest the correct behaviour on this?

https://docs.apigee.com/api-platform/reference/policies/spike-arrest-policy

Sample policy defined

<SpikeArrest async="false" continueOnError="false" enabled="true" name="SpikeArrest">

<DisplayName>SpikeArrest</DisplayName>

<Rate>10pm</Rate>

<UseEffectiveCount>true</UseEffectiveCount>

</SpikeArrest>

0 3 520
3 REPLIES 3

cleisommais
Participant II

Hi,

I checked in my account what you said, however my response status is 429 Too many request.

My Spike arrest to test:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<SpikeArrest async="false" continueOnError="false" enabled="true" name="Spike-Arrest">
    <DisplayName>Spike-Arrest</DisplayName>
    <Properties/>
    <Rate>2pm</Rate>
</SpikeArrest>

The response payload:

{
    "fault": {
        "faultstring": "Spike arrest violation. Allowed rate : MessageRate{messagesPerPeriod=2, periodInMicroseconds=60000000, maxBurstMessageCount=1.0}",
        "detail": {
            "errorcode": "policies.ratelimit.SpikeArrestViolation"
        }
    }
}

Thanks Cleison Melo.

I am getting same payload but status is 500. I am testing this using postman. Let me check server logs one time

{ "fault": { "faultstring": "Spike arrest violation. Allowed rate : MessageRate{messagesPerPeriod=10, periodInMicroseconds=60000000, maxBurstMessageCount=1.0}", "detail": { "errorcode": "policies.ratelimit.SpikeArrestViolation" } } }

I have verified the logs and am getting 500. We are using Edge version 4.19.06.00. Can you please suggest is there any place we are missing for this?