Versions Compared

Key

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

...

This samples demonstrates how a message can be passed through the WSO2 ESB and logged before it is delivered to its receiver. This is the most basic, introductory usecase of the ESB.

Prerequisites

 

...

Start the Synapse configuration numbered 0: for example, wso2esb-samples.sh -sn 0 (Run ESB in debug mode??)

Start the Axis2 server and deploy the SimpleStockQuoteService if not already deployed. (PDF section Starting the Sample Services)

Building the Sample

 

 Run ESB in debug mode.

Go to the bin directory of the distribution and run the build.xml file which resides in that directory using Apache Ant.

Executing the Sample

 

Code Block
languagehtml/xml
<definitions xmlns="http://ws.apache.org/ns/synapse">
   <sequence name="main">
      <in>
         <!-- log all attributes of messages passing through -->
         <log level="full"/>
         <!-- Send the message to implicit destination -->
         <send/>
      </in>
      <out>
         <!-- log all attributes of messages passing through -->
         <log level="full"/>
         <!-- send the message back to the client -->
         <send/>
      </out>
   </sequence>
</definitions>

...

Refer to Sample 1 Simple Content-Based Routing (CBR) of Messages.

Prerequisites
  • Start the Synapse configuration numbered 0: for example, wso2esb-samples.sh -sn 0
  • Start the Axis2 server and deploy the SimpleStockQuoteService if not already deployed.

 

Execute the Smart Client

By tracing the execution of ESB with the log output level set to DEBUG, you will see the client request arriving at ESB with a WS-Addressing To set to EPR http://localhost:9000/services/SimpleStockQuoteService.The ESB engine logs the message at the "full" log level (all the message headers and the body) then sends the message to its implicit To address which is http://localhost:9000/services/SimpleStockQuoteService.You will see a message in the Axis2 server console confirming that the message got routed to the sample server and the sample service hosted at the sample server generating a stock quote for the requested symbol.

...

You will see exactly the same behavior as per the previous example when you run this scenario. However, this time the difference is at the client, as it sends the message to the WS-Addressing To address http://localhost:9000/services/SimpleStockQuoteService, but the transport specifies ESB as the HTTP Proxy.Analysis of Results

Excerpt
hiddentrue

Example of message mediation in WSO2 ESB.