This documentation is for WSO2 Enterprise Service Bus version 5.0.0. For the latest ESB, view the latest WSO2 Enterprise Integrator documentation.

All docs This doc
Skip to end of metadata
Go to start of metadata

Objective: Invoke REST messages with a plain-old XML (POX) back end using the message store and Message Forwarding Processor.

<definitions xmlns="">
   <registry provider="org.wso2.carbon.mediation.registry.WSO2Registry">
      <parameter name="cachableDuration">15000</parameter>
   <proxy name="StockQuoteProxy" transports="https http" startOnLoad="true" trace="disable">
      <description />
            <property name="FORCE_SC_ACCEPTED" value="true" scope="axis2" />
            <property name="OUT_ONLY" value="true" />
            <property name="messageType" value="application/xml" scope="axis2" />
            <store messageStore="MSG_STORE" />
            <send />
   <endpoint name="SecureStockQuoteService">
      <address uri="http://localhost:9000/services/SimpleStockQuoteService" format="rest" />
   <sequence name="fault">
      <log level="full">
         <property name="MESSAGE" value="Executing default 'fault' sequence" />
         <property name="ERROR_CODE" expression="get-property('ERROR_CODE')" />
         <property name="ERROR_MESSAGE" expression="get-property('ERROR_MESSAGE')" />
      <drop />
   <sequence name="main">
         <log level="full" />
         <filter source="get-property('To')" regex="http://localhost:9000.*">
            <send />
         <send />
      <description>The main sequence for the message mediation</description>
   <messageStore name="MSG_STORE" />
   <messageProcessor class="org.apache.synapse.message.processor.impl.forwarder.ScheduledMessageForwardingProcessor" name="SecureForwardingProcessor" targetEndpoint="SecureStockQuoteService" messageStore="MSG_STORE">
      <parameter name="client.retry.interval">1000</parameter>
      <parameter name="interval">1000</parameter>
      <parameter name="">true</parameter>


  • Start the Synapse configuration numbered 704, e.g., -sn 704
  • Start the Axis2 server and deploy the SecureStockQuoteService if you have not done so already.

This sample demonstrate how to do RESTful invocations with the message store and message forwarding processor. Though in this sample we have used an In memory message store, these instructions are valid for any available message store implementations. Use the stockqoute client to send the following placeorder request:

ant stockquote -Daddurl=http://localhost:8280/services/StockQuoteProxy -Dmode=placeorder -Dsymbol=WSO2

You can see the message sent by the ESB to the secure service using a TCPMon. Upon successful execution, there should be a message on the back end as follows:

Sun Aug 18 10:58:00 IST 2013  :: Accepted order #5 for : 18851 stocks of WSO2 at $ 61.782478265721714
  • No labels