Mediation Sequences

A mediation sequence is a set of mediators organized into a logical flow, allowing you to implement pipes and filter patterns. The mediators in the sequence will perform the necessary message processing and route the message to the required destination.

Typically, the required mediation sequences are defined within the proxy service or the REST API. This includes an In sequence, an Out sequence, and a default fault sequence.

All messages that are not destined for a proxy service or REST API are sent through the main sequence. Some other sequences (named sequences) are defined independant of the proxy service, or REST API, and then reused in one or several proxy services, REST APIs for efficiency.

mediation sequence

IN/OUT Sequences

Once a request message is received by the proxy service, REST API, inbound endpoint, or even the main sequence, the message is injected to the IN sequence. The OUT sequence defines the mediation logic that processes the response message before sending the response back to the client.

Fault Sequences

Fault sequences are used for error handling in message mediation. A fault sequence is a collection of mediators just like any other sequence, and it can be associated with another sequence, proxy service, or REST API. When an error occurs in the mediation logic, the message that triggered the error is delegated to the specified fault sequence. The mediators in the fault sequence can then log the erroneous message, forward it to a special error-tracking service, and send a SOAP fault back to the client indicating the error or even send an email to the system admin.

fault sequence

If a fault sequence is not specified explicitly, the default fault sequence of the proxy service or REST API will be used to handle errors. The default fault sequence will log the message, the payload, and any error/exception encountered before the Drop mediator stops further processing. You should configure the fault sequence for error handling instead of simply dropping messages.

Named Sequences

A named sequence is a custom, reusable sequence that holds a specific mediation logic. You can create named sequences and reuse them within your project. A fault sequence is an example of a named sequence that can be used to replace the default fault sequence of a proxy service, or REST API. While the main sequence, proxy service, and REST API contain IN and OUT sequences to define a specific in flow and out flow of messages, a named sequence is simply a combination of mediators that can be reused within an IN sequence or Out sequence.

To reuse a named sequence in multiple integration projects, you need to save it as a dynamic sequence.

Dynamic Sequences

When you create a named sequence, you can save it as a registry resource in the product's registry. This sequence can then be dynamically reused in the mediation flow of any of your integration projects by specifying the registry path.

Main Sequence

All messages that are not destined for a proxy service, REST API, or inbound endpoint are sent through the main sequence. A sequence functions as the main sequence when it is named 'main'. By default, the main sequence simply sends a message without mediation. Therefore, to add message mediation, you can add mediators and/or named sequences to the main sequence.

Top