The content in this documentation is for older versions of WSO2 products. For updated information on Enterprise Integration Patterns, go to the latest Micro Integrator documentation. "> The content in this documentation is for older versions of WSO2 products. For updated information on Enterprise Integration Patterns, go to the latest Micro Integrator documentation.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 30 Next »

The Message Endpoint EIP encapsulates the messaging system from the rest of the application and customizes a general messaging API for a specific application and task. Therefore, you can change the message API just by changing the endpoint code. This improves the maintainability of applications.

For more information, go to Message Endpoint.

The following sections explain how you can implement a sample scenario of this EIP using the ESB profile of WSO2 EI. 

Sample scenario

The example scenario depicts how a stock quote is generated when a request is sent to the ESB profile of WSO2 EI. The sender sends the request to the ESB profile, where the request is then diverted to the Stock Quote service. 

 The Synapse configurations of the artifacts

When you unzip the ZIP file you download below in Step 6 when simulating the sample scenario, you can find the below configurations in the <UNZIPPED_FILE>/src/main/synapse-config directory. For more information about these artifacts, go to WSO2 EI Documentation.

Proxy Service
<?xml version="1.0" encoding="UTF-8"?>
<proxy name="message-endpoint-proxy" startOnLoad="true" transports="http https"
    xmlns="http://ws.apache.org/ns/synapse">
    <target>
        <inSequence>
            <!-- Sends the message to the specified service -->
            <send>
                <endpoint>
                    <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
                </endpoint>
            </send>
        </inSequence>
        <outSequence>
            <respond/>
        </outSequence>
        <faultSequence/>
    </target>
</proxy>

Setting up the sample scenario

Follow the below instructions to simulate this sample scenario.

Executing the sample

Send a request using a SOAP request client (such as SoapUI) to the ESB profile of WSO2 EI in the following manner:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://services.samples" xmlns:xsd="http://services.samples/xsd">
   <soapenv:Header/>
   <soapenv:Body>
      <ser:getQuote>    
         <ser:request>          
            <xsd:symbol>foo</xsd:symbol>
         </ser:request>         
      </ser:getQuote>
   </soapenv:Body>
</soapenv:Envelope>

Analyzing the output

After sending the request to the ESB profile of WSO2 EI through the client, notice that the Stock Quote service has received the inventory and logged the message.
samples.services.SimpleStockQuoteService :: Generating quote for : foo

  • No labels