There are two ways of writing the ESB mediator:
- Using Class Mediator - This does not allow mediator specific XML configurations. See Writing Custom Mediator Implementations for more information.
- Writing the mediator with Factory and Serialize methods - This allows mediator to have its own XML configuration. See Writing Custom Configuration Implementations for Mediators for more information.
The message content is accessed by some mediators in some mediation scenarios while it is not accessed in the other scenarios. Mediators can be classified as follows based on this aspect.
- 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 an example a simple
Log Mediator instance (i.e. configured as
<log/>
) is content-unaware. However a log mediator configured as<log level=”full”/>
would be content-aware since it is expected to log the message payload.
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
|
---|---|---|
Core | Call | Invoke a service in non blocking synchronous manner |
Enqueue | Uses 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 | |
Respond | Stops 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 Template | Constructs 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 | |
Validate | Validates XML messages against a specified schema. | |
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 |
FastXSLT | Performs XSLT transformations on the message stream | |
URLRewrite | Modifies and rewrites URLs or URL fragments | |
XQuery | Performs XQuery transformation | |
Header | Sets or removes SOAP headers | |
Fault (also called Makefault) | Create SOAP Faults | |
PayloadFactory | Transforms or replaces message content in between the client and the backend server | |
Advanced | Cache | Evaluates messages based on whether the same message came to the ESB |
ForEach | Splits a message into a number of different messages by finding matching elements in an XPath expression of the original message. | |
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 | |
DBReport | Writes data to database | |
DBLookup | Retrieves information from database | |
EJB | Calls an external Enterprise JavaBean(EJB) and stores the result in the message payload or in a message context property. | |
Rule | Executes rules | |
Entitlement | Evaluates user actions against a XACML policy | |
OAuth | 2-legged OAuth support | |
Smooks | Used to apply lightweight transformations on messages in an efficient manner. | |
Extension | Bean | Manipulates JavaBeans |
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 | |
Agent | BAM | Captures data events and sends them to the BAM server |
References
No comments:
Post a Comment