| Element | Default | Type | Description |
|---|---|---|---|
| `Identifier` \(Optional\) | N/A | String |
Flow variable used for identifying the application or client.
> ### Sample Code:
> ```
> |
| Attribute | Default | Type | Description |
|---|---|---|---|
| `ref` \(Required\) | N/A | N/A | Identifies the flow variable by which Spike Arrest groups incoming requests. |
| Element | Default | Type | Description |
|---|---|---|---|
| `MessageWeight` \(Optional\) | N/A | Integer |
Specifies the weight defined for each message.
Message weight modifies the impact of a single request on the calculation of the SpikeArrest limit. Message weight can be set by variables based on HTTP headers, query parameters, or message body content.
For example, if the SpikeArrest Rate is 10 per minute, and an application submits requests with weight 5, then only 2 messages are permitted per minute from that application.
> ### Sample Code:
> ```
> |
| Attribute | Default | Type | Description |
|---|---|---|---|
| `ref` \(Required\) | N/A | N/A | Identifies the flow variable that contains the message weight for the specific client. This can be any flow variable, such as an HTTP query param, header, or message body content. |
| Element | Default | Type | Description |
|---|---|---|---|
| `Rate` \(Required\) | N/A | Interger |
Specifies the rate at which to limit the traffic spike \(or burst\).
Valid value: integer per |
| Element | Default | Type | Description |
|---|---|---|---|
| `UseEffectiveCount` \(Optional\) | N/A | Boolean |
Distributes your Spike Arrest count across Message Processors \(MPs\) when using auto-scaling groups.
> ### Sample Code:
> ```
> |
| Variable | Type | Permission | Description |
|---|---|---|---|
| ratelimit.\{policy\_name\}.failed | Boolean | Read-Only | Indicates whether or not the policy failed \(true or false\). |
| Error Name | HTTP Status | Cause |
|---|---|---|
| SpikeArrestViolation | 500 | The rate limit is exceeded. |
| InvalidMessageWeight | 500 | The message weight value must be an integer. |
| FailedToResolveSpikeArrestRate | 500 | The referenced variable used to specify the rate can't be resolved. |
| InvalidAllowedRate | 500 |
If the spike arrest rate specified in the ` |
| Variable Set | Where | Example |
|---|---|---|
| \[prefix\].\[policy\_name\].failed | The fault variable \[prefix\] is rate limit. The \[policy\_name\] is the name of the policy that threw the error. | ratelimit.SA-SpikeArrestPolicy.failed = true |
| fault.\[error\_name\] | \[error\_name\] = The specific error name to check for as listed in the table above. | fault.name Matches "SpikeArrestViolation" |