Store Mediator

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.

<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.

<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 Name Description
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, select Value for Specify As , and select 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 Sequence The sequence< that will be called before the message gets stored. This sequence should be predefined 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.


Following are examples demonstrating the usage of the Store mediator.

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 .

<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>

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.

<?xml version="1.0" encoding="UTF-8"?>
    <proxy xmlns="" name="StoreMediatorProxy" startOnLoad="true" transports="http https">
                    messageStore="{//ser:getQuote/ser:request/ser:symbol}" xmlns:ser="http://services.samples"/>
    <endpoint xmlns="" name="StoreMediatorEndpoint">
        <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
    <sequence xmlns="" name="errorHandler">
        <!-- 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 -->
    <proxy name="SimpleProxy" transports="http https" startonload="true" trace="disable" xmlns="">
            <!-- 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) -->
             <sequence key="errorHandler"/>
    <messageStore xmlns="" name="StoreMediatorStore"/>
    <messageProcessor xmlns=""
        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>