How do I configure matching rules for Multi-Protocol Gateway error rules in HTTP transactions?
With error rules and their associated matching rule, you can define the transaction flow when an error occurs in Multi-Protocol Gateway transactions. A matching rule evaluates the actual error condition against the expressions in the matching rule to determine which error rule to run. In general, the matching rule in a processing policy can run its associated error rule as the error handler.
In DataPower firmware release 6.0.0, when the error occurs in an HTTP transaction and no preceding error handler processes the error, the matching rule in the Multi-Protocol Gateway Default Error Policy is evaluated and runs its associated error action when the matching rule is met. This process happens when the transaction request is received through the HTTP or HTTPS handler and evaluated against the Default Error Policy (Multi-Protocol Gateway > Advanced > Default Error Policy).
Currently, the Multi-Protocol Gateway provides a variety of matching rule expression flavors, but not all of them are supported in the error flow. For example, an expression can be defined in the matching rule, but the evaluation result is always false for particular types of transaction flows.
For errors that occur in an HTTP transaction, the expression types and the supported flows are as follows:
- URL - Use a shell-style pattern to test against the incoming URL string. URL-matching is fully supported on all flows: Request, response, and error flow.
- Error Code - Use a shell-style pattern to test against a particular error code. Error code-matching is literally to support only the matching on error flows.
- HTTP - Use a shell-style pattern to test against the HTTP header value. HTTP header value-matching supports matching on all headers in request and response flows, but only on the Content-Type header in an error flow.
- HTTP Method - Use an HTTP method such as POST and GET to test against the incoming HTTP request. You can use HTTP method-matching in request and response flows but not in an error flow.
- XPath - Use an XPath expression to test against the message content. You can use XPath-matching in request and response flows but not in an error flow.
Legacy (deprecated) types:
- Full URL - Legacy expression type. Instead, use URL-matching.
- Host - Legacy expression type. Instead, use HTTP header value-matching.
With this information, in an error flow, use the combination of the supported matching types: URL, Error Code, and HTTP Content-Type header.