All docs This doc

Versions Compared

Key

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

This section explains, through an example scenario, how the Request-Reply Message EIP can be implemented using the ESB profile of WSO2 ESBEI. The following topics are covered:

Table of Contents

...

The diagram below depicts how to simulate the example scenario using the WSO2 ESB profile.

Figure 2: Example Scenario of the Request-Reply EIP

Before digging into implementation details, let's take a look at the relationship between the example scenario and the Request-Reply EIP by comparing their core components.

Request-Reply EIP (Figure 1)Request-Reply Example Scenario (Figure 2)
RequestorSimple Stock Quote Client
Request ChannelSend, Endpoint
ReplierStock Quote Service Instance
Reply ChannelSend, Endpoint

Environment setup

  1. Download and install
  2. WSO2 ESB from http://wso2.com/products/enterprise-service-bus.
  3. the ESB profile of WSO2 Enterprise Integrator (EI). For a list of prerequisites and step-by-step installation instructions,
  4. refer to Installation Guide in the WSO2 ESB documentation
  5. go to Installing the Product in WSO2 EI Documentation.
  6. Start
  7. the sample
  8. an instance of Sample Axis2 server. For instructions,
  9. refer to the section ESB Samples Setup - Starting Sample Back-End Services in the WSO2 ESB documentation
  10. go to Starting the Axis2 server in WSO2 EI Documentation.
  11. Deploy the back-end service SimpleStockQuoteService. For instructions on deploying sample back-end services, go to Deploying sample back-end services in WSO2 EI Documentation.

ESB configuration

Start the ESB

...

profile and log into its

...

Management Console. For instructions, see Starting the ESB profile in WSO2 EI Documentation.

On the Management Console, navigate to the Main Menu and click Source View in the Service Bus section. Copy and paste the following configuration to the source view. You can now explore the example scenario. 

Anchor
step3
step3

Code Block
languagehtml/xml
linenumberstrue
<?xml version="1.0" encoding="UTF-8"?> 
 <definitions xmlns="http://ws.apache.org/ns/synapse">
  <proxy name="ProxyService" transports="http https" startOnLoad="true">
        <target>
           <inSequence>
              <send>
                 <endpoint>
                    <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
                 </endpoint>
              </send>
           </inSequence>
           <outSequence>
              <send/>
           </outSequence>
        </target>
     </proxy>
 </definitions>

...

Let's investigate the elements of the ESB configuration in detail. The line numbers below are mapped with the ESB configuration shown above.  

  • inSequence [line 5 in ESB config] - When a client sends a message, it is picked up by the inSequence.
  • send [line 6 in ESB config] -  The send mediator sends the message to the endpoint running on port 9000.
  • outSequence [line 12 in ESB config] - The processed response from the endpoint will be sent back to the client through the outSequence. The send mediator inside the outSequence will direct the message back to the requesting client, which is on a channel separate from the requesting channel.