Versions Compared

Key

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

...

Setup instructions are given in section Installation Prerequisites.

Building the Sample

But to To build and run samples, the ESB should be started with a sample configuration by executing wso2esb-samples.bat (for Windows) or wso2esb-samples.sh (for Linux) script found in <ESB_HOME>/bin directory. The sample configurations for ESB can be found in <ESB_HOME>/repository/samples directory.

You can switch from the default INFO log messages to DEBUG log messages by changing the line 'log4j.category.org.apache.synapse=INFO' to 'log4j.category.org.apache.synapse=DEBUG' in the <ESB_HOME>/repository/conf/log4j.properties file.

1. Since this is sample 0, execute the following command to start the Synapse configuration numbered 0. It will start an instance of the ESB in the configuration used for this sample.

...

Code Block
wso2esb-samples.bat -sn 0

2. A message will should appear on the command or Linux console if stating the server started successfully.3. Next, deploy the back-end service SimpleStockQuoteService.

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. 

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.

...