A mediation sequence, commonly called a "sequence," is a tree of mediators. That means it can hold other mediators and execute them. When a message is delivered to a sequence, it sends the message through all its child mediators.
Image RemovedImage Added
There are two types of sequences:
Code Block |
---|
|
<sequence name="string">other mediators</sequence>
|
...
Code Block |
---|
|
<sequence key="name"/>
|
The named sequences refer other sequences using a key. This allows reusing of sequences.
...
Code Block |
---|
|
<syn:sequence name="main" xmlns:syn="http://ws.apache.org/ns/synapse">
<syn:log/>
<syn:drop/>
</syn:sequence>
|
Code Block |
---|
|
<syn:sequence name="fault" xmlns:syn="http://ws.apache.org/ns/synapse">
<syn:log level="full">
<syn:property name="MESSAGE" value="Executing default"fault" sequence"/>
<syn:property name="ERROR_CODE" expression="get-property('ERROR_CODE')"/>
<syn:property name="ERROR_MESSAGE" expression="get-property('ERROR_MESSAGE')"/>
</syn:log>
<syn:drop/>
</syn:sequence>
|
Refer to the list of available properties in Properties.
All the messages that are not for Proxy Services will be sent through the "main" sequence.
A sequence can have an error handler. Error handler is again another sequence. If an error occurs while executing a sequence, its error handler will be called. Every sequence has an error handler. If one is not explicitly specified, the fault sequence will be treated as the error handler. Refer to an example of error handling here.
Info |
---|
|
Message mediation always processes messages according to the mediation sequence defined as "main." |
Excerpt |
---|
|
General information about Mediation Sequences in WSO2 ESB. |