Skip to content

Using the Message Forwarding Processor

This example demonstrates the usage of the message forwarding processor.

Synapse configuration

Following are the artifact configurations that we can use to implement this scenario. See the instructions on how to build and run this example.

<proxy xmlns="" name="StockQuoteProxy" transports="https http" startOnLoad="true" trace="disable">
          <description />
        <log level="full"/>
        <property name="FORCE_SC_ACCEPTED" scope="axis2" value="true"/>
        <property name="OUT_ONLY" value="true"/>
        <store messageStore="MyStore"/>
      <send />
<messageStore xmlns="" name="MyStore"/>
<messageProcessor xmlns=""
    messageStore="MyStore" name="ScheduledProcessor" targetEndpoint="StockQuoteServiceEp">
    <parameter name="interval">10000</parameter>
    <parameter name="throttle">false</parameter>
    <parameter name="target.endpoint">StockQuoteServiceEp</parameter>
<endpoint xmlns="" name="StockQuoteServiceEp">
    <address uri="http://localhost:9000/services/SimpleStockQuoteService">

Build and run

Create the artifacts:

  1. Set up WSO2 Integration Studio.
  2. Create an integration project with an ESB Configs module and an Composite Exporter.
  3. Create the proxy service, endpoint, message store and message processor with the configurations given above.
  4. Deploy the artifacts in your Micro Integrator.

Configure the ActiveMQ broker and set up the JMS Sender.

Set up the back-end service:

  1. Download the back-end service.
  2. Extract the downloaded zip file.
  3. Open a terminal, navigate to the axis2Server/bin/ directory inside the extracted folder.
  4. Execute the following command to start the axis2server with the SimpleStockQuote back-end service:


Send the following request to invoke the service:

POST http://localhost:9090/services/StockQuoteProxy HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: "urn:getQuote"
Content-Length: 492
Host: localhost:9090
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

<soapenv:Envelope xmlns:soapenv="" xmlns:ser="http://services.samples" xmlns:xsd="http://services.samples/xsd">
      <ser:getQuote xmlns:ser="http://services.samples" xmlns:xsd="http://services.samples/xsd">

Now Start the SimpleStockQuoteService. When you Start the service you will see message getting delivered to the service. Even though service is down when we invoke it from the client. Here in the Proxy Service store mediator will store the getQuote request message in the "MyStore" Message Store. Message Processor will send the message to the endpoint configured as a message context property. Message processor will remove the message from the store only if message delivered successfully.