This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Mediators

A mediator is a full-powered processing unit in the ESB. At run-time, a mediator has access to all the parts of the ESB along with the current message and can do virtually anything with the message.

When adding a mediator to a sequence, you can configure the mediator in design view or in source view, which allows you to edit the source XML (different mediators have their own XML configurations). Mediators in a sequence can be one of the following types:

  • Node mediators - Contains child mediators.
  • Leaf mediators - Does not hold any other child mediators.

Mediators are considered to be one of the main mechanisms for extending an ESB. You can write a custom mediator and add it to the ESB. This custom mediator and any other built-in mediator will be exactly the same as the API and the privileges.

The standard mediators in WSO2 ESB are listed in the table below. Click a link for details on that mediator. There are also many samples that demonstrate how to use mediators.

The Mediator Catalog

Category

Name

Description

CoreCallInvoke a service in non blocking synchronous manner
 EnqueueUses a priority executor to ensure high-priority messages are not dropped

 

Send

Sends a message

 

Loopback

Moves the message from the In flow to the Out flow, skipping all remaining configuration in the In flow

 

Sequence

Inserts a reference to a sequence

 RespondStops processing on the message and sends it back to the client
 Event

Sends event notifications to an event source, publishes messages to predefined topics

 

Drop

Drops a message

 Call TemplateConstructs a sequence by passing values into a sequence template

 

Enrich

Enriches a message

 

Property

Sets or remove properties associated with the message

 

Log

Logs a message

Filter

Filter

Filters a message using XPath, if-else kind of logic

 

Out

Applies to messages that are in the Out path of the ESB

 

In

Applies to messages that are in the In path of the ESB

 

Switch

Filters messages using XPath, switch logic

 

Router

Routes messages based on XPath filtering

 

Conditional Router

Implements complex routing rules (Header based routing, content based routing and other rules)

Transform

XSLT

Performs XSLT transformations on the XML payload

 FastXSLTPerforms XSLT transformations on the message stream

 

URLRewrite

Modifies and rewrites URLs or URL fragments

 

XQueryPerforms XQuery transformation

 

Header

Sets or removes SOAP headers

 

Fault (also called Makefault)

Create SOAP Faults

 PayloadFactoryTransforms or replaces message content in between the client and the backend server

Advanced

Cache

Evaluate messages based on whether the same message came to the ESB

 

Clone

Clones a message

 

Store

Stores messages in a predefined message store

 

Iterate

Splits a message

 

Aggregate

Combines a message

 

Callout

Blocks web services calls

 

Transaction

Executes a set of mediators transactionally

 

Throttle

Limits the number of messages

 

RMSequence

Reliable messaging

 

DBReport

Writes data to database

 

DBLookup

Retrieves information from database

 

Rule

Executes rules

 

Entitlement

Evaluates user actions against a XACML policy

 

OAuth

2-legged OAuth support

Extension

Class

Creates and executes a custom mediator

 

POJOCommand

Executes a custom command

 

Script

Executes a mediator written in Scripting language

 

Spring

Creates a mediator managed by Spring

 

Smooks

Used to apply lightweight transformations on messages in an efficient manner

AgentBAMCaptures data events and sends them to the BAM server