This documentation is for WSO2 Enterprise Service Bus version 4.7.0 . View documentation for the latest release.
Skip to end of metadata
Go to start of metadata

Introduction

This sample demonstrates the functionality of header, In and Out Mediators.

Prerequisites

For a list of prerequisites, see the Prerequisites section in ESB Samples Setup.

Building the Sample

1. Start the ESB with sample 6 configuration using the instructions given in Starting Sample ESB Configurations.

2. A message should appear in the command or text Linux console stating the server started successfully.

3. The synapse configuration in the ESB used for message mediation in this sample is provided in <ESB_HOME>/repository/samples/synapse_sample_6.xml as shown below:

<definitions xmlns="http://ws.apache.org/ns/synapse">
    <in>
        <header name="To" value="http://localhost:9000/services/SimpleStockQuoteService"/>
    </in>
    <send/>
</definitions>

4. Deploy the back-end service 'SimpleStockQuoteService' and start the Axis2 server using the instructions given in section Starting Sample Back-End Services.

5. Now you have a running ESB instance and a back-end service deployed. In the next section, we will send a message to the back-end service through the ESB using a sample client.

Executing the Sample

The sample client used here is 'Stock Quote Client' which can operate in several modes. For instructions on this sample client and its operation modes, refer to Stock Quote Client

Dumb Client Mode

1. The synapse_sample_6.xml file sets the "To" EPR of the message to ESB. Then the In Mediator processes the incoming messages, and manipulates the "To" header to refer to the stock quote service on the sample Axis2 server.

2. As a result, it is possible to request for a stock quote as follows. Run the following ant command from <ESB_HOME>/samples/axis2Client directory to trigger the client in the dumb client mode.

ant stockquote -Dtrpurl=http://localhost:8280/
  • No labels