Interrupt policy can be used to break the entire request processing in case of a condition (to define on the policy.
By default, if no policy condition is defined, the policy will always break request processing).
Breaking the request processing means that no more policy will be executed and no endpoint will be called by the gateway.
By default, the policy will return a response payload to the consumer which is containing the message (see the
configuration section).
If you want to override this standard response from the policy, you can define an errorKey which will be then be used to
define a Response Template.
| Plugin version | APIM version | AM Version |
|---|---|---|
1.x |
3.10.x to 4.5.x |
3.10.x to 4.10.x |
2.x |
4.6.x to latest |
4.6.x to latest |
| Property | Required | Description | Type | Default |
|---|---|---|---|---|
statusCode |
- |
The HTTP status code of the interruption response |
integer |
500 |
errorKey |
X |
The error Key to use for defining a Response Template |
string |
- |
message |
X |
Default response template |
string |
- |
variables |
- |
The variables for Response Template purpose |
List of variables |
- |
"policy-interrupt": {
"statusCode": 503,
"errorKey": "MY_CUSTOM_KEY",
"message": "You got a problem, sir !",
"variables": [{
"name": "custom-variable",
"value": "{#request.headers['origin']}"
}]
}