Difference in error response for Spike Arrest policy

Hello All,

Can anyone explain why error response for Spike arrest policy is different for below two cases.

1. <Rate>4pm</Rate>
<UseEffectiveCount>false</UseEffectiveCount>

Error response :

"faultstring": "Spike arrest violation. Allowed rate : MessageRate{messagesPerPeriod=4, periodInMicroseconds=60000000, maxBurstMessageCount=1.0}"

2. <Rate>4pm</Rate>
<UseEffectiveCount>true</UseEffectiveCount>

Error response :

"faultstring": "Spike arrest violation. Allowed rate : MessageRate{messagesPerPeriod=4, periodInMicroseconds=720000000, maxBurstMessageCount=1.0}"

Solved Solved
0 5 622
1 ACCEPTED SOLUTION

This looks to me like the period is larger to compensate for the fact that the 4pm rate is shared over 12 message processors (720/60) when UseEffectiveCount = true.

View solution in original post

5 REPLIES 5

This looks to me like the period is larger to compensate for the fact that the 4pm rate is shared over 12 message processors (720/60) when UseEffectiveCount = true.

Thanks for the reply Christian, seems to be same. From the error response it is shown as 4 requests for 12 minutes where as we are giving it as 4 request for 1 minute.

Is there a way we can change this default error response?

You can change the error response by using an AssignMessage Policy in a FaultRule. This example: https://docs.apigee.com/api-platform/fundamentals/fault-handling#example is for a different fault but should give you the general idea.

Thankyou...I'm trying to implement this as a part of shared flow. I guess, FaultRule will not work in this case.

yes, you have to put in proxy.