This is the latest release in the 6.x.x family. For EI 7.0.0, click here.

All docs This doc

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.

The Store mediator enqueues messages passing through its mediation sequence in a given message store. It can serve as a dead letter channel if it is included in a fault sequence and if its message store is connected to a message processor that forwards all the messages in the store to an endpoint.



The Store mediator is a content aware mediator.

Code Block
<axis2ns1:store xmlns:axis2ns1="" messageStore="JMSMS" sequence="storeSequence"></axis2ns1:store>

You can dynamically route messages to a Message Store via the Store mediator by resolving the name of the Message Store from the message context. To enable this, give a path expression (followed by its namespace definitions) for the value of the store name attribute as shown below.

Code Block
<axis2ns1:store xmlns:axis2ns1="" messagestore="{//m:msgstr/m:arg/m:value}"
xmlns:m="http://services.samples/xsd" sequence="storeSequence"></axis2ns1:store>


The parameters available to configure the Store mediator is as follows.

Parameter NameDescription
Message Store

The Message Store, in which messages will be stored. You can give the name of the Message Store either as a value or as an expression.


You should add the message store to the ESB profile before you can select it here.

  • To give the Message Store name as a value, selectValue for Specify As, and selct the name of the Message Store from the drop down of Value.
  • To give the Message Store name as an expression, select Expression for Specify As, and enter the XPath to derive the Message Store from the message context.

    In the namespace editor, add the namespaces that are used in the XPath.

On Store SequenceThe sequence that will be called before the message gets stored. This sequence  should be pre-defined in the registry before it can be entered here. Click either Configuration Registry or Governance Registry to select the required sequence from the resource tree. For more information on configuring the Registry, go to Working with the Registry in the Common Admin Guide.


Following are examples demonstrating the usage of the Store mediator.

Example 1 - Defining the Message Store as a value 

A proxy service can be configured with the Store mediator as follows to save messages in a message store named JMSMS.

Code Block
<proxy name="SimpleProxy" transports="http https" startonload="true" trace="disable" xmlns="">
         <property name="FORCE_SC_ACCEPTED" value="true" scope="axis2" type="STRING"></property>
         <property name="OUT_ONLY" value="true" scope="default" type="STRING"></property>
         <store messageStore="JMSMS"></store>

Example 2 - Defining the Message Store as an XPath expression

A proxy service can be configured with the Store mediator as follows to save messages in a Message Store, which is dynamically set via the message context specified using an XPath expression.


You can use the SimpleStock Quote service as the backend service and SOAP UI as the Client to try out the below example.

Code Block
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="">
    <registry provider="org.wso2.carbon.mediation.registry.WSO2Registry">
        <parameter name="cachableDuration">15000</parameter>
    <taskManager provider="org.wso2.carbon.mediation.ntask.NTaskTaskManager"/>
    <proxy name="StoreMediatorProxy" startOnLoad="true" transports="http https">
                    messageStore="{//ser:getQuote/ser:request/ser:symbol}" xmlns:ser="http://services.samples"/>
    <endpoint name="StoreMediatorEndpoint">
        <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
    <sequence name="fault">
        <!-- Log the message at the full log level with the ERROR_MESSAGE and the ERROR_CODE-->
        <log level="full">
            <property name="MESSAGE" value="Executing default 'fault' sequence"/>
            <property expression="get-property('ERROR_CODE')" name="ERROR_CODE"/>
            <property expression="get-property('ERROR_MESSAGE')" name="ERROR_MESSAGE"/>
        <!-- Drops the messages by default if there is a fault -->
    <sequence name="main">
            <!-- Log all messages passing through -->
            <log level="full"/>
            <!-- ensure that the default configuration only sends if it is one of samples -->
            <!-- Otherwise Synapse would be an open proxy by default (BAD!)               -->
            <filter regex="http://localhost:9000.*" source="get-property('To')">
                <!-- Send the messages where they have been sent (i.e. implicit "To" EPR) -->
        <description>The main sequence for the message mediation</description>
    <messageStore name="StoreMediatorStore"/>
        messageStore="StoreMediatorStore" name="StoreMediatorProcessor" targetEndpoint="StoreMediatorEndpoint">
        <parameter name="client.retry.interval">1000</parameter>
        <parameter name="throttle">false</parameter>
        <parameter name="">4</parameter>
        <parameter name="member.count">1</parameter>
        <parameter name="">Disabled</parameter>
        <parameter name="interval">1000</parameter>
        <parameter name="">true</parameter>
        <parameter name="target.endpoint">StoreMediatorEndpoint</parameter>
    <!-- You can add any flat sequences, endpoints, etc.. to this synapse.xml file if you do
    *not* want to keep the artifacts in several files -->