Mediators are individual processing units that perform a specific function on messages that pass through the Micro Integrator. The mediator takes the message received by the proxy service or REST API, carries out some predefined actions on it (such as transforming, enriching, filtering), and outputs the modified message.
For example, the Clone mediator splits a message into several clones, the Send mediator sends the messages, and the Aggregate mediator collects and merges the responses before sending them back to the client.
Mediators also include functionality to match incompatible protocols, data formats, and interaction patterns across different resources. XQuery and XSLT mediators allow rich transformations on the messages. The Rule mediator allows users to cope with the uncertainty of business logic through rule-based message mediation. Content-based routing using XPath filtering is supported in different flavors, allowing users to get the most convenient configuration experience. Built-in capability to handle transactions allow message mediation to be done transactionally inside the Micro Integrator.
Mediators are always defined within a mediation sequence.
Classification of Mediators¶
Mediators are classified as follows based on whether or not they access the message's content:
|Content-Aware mediators||These mediators always access the message content when mediating messages (e.g., Enrich mediator).|
|Content-Unaware mediators||These mediators never access the message content when mediating messages (e.g., Send mediator).|
|Conditionally Content-Aware mediators||
These mediators could be either content-aware or content-unaware depending on their exact instance configuration. For example, a simple mediator instance (i.e. configured as
List of Mediators¶
WSO2 Micro Integrator includes a comprehensive library of mediators that provide functionality for implementing widely used Enterprise Integration Patterns (EIPs). You can also easily write a custom mediator to provide additional functionality using various technologies such as Java, scripting, and Spring.