Versions Compared

Key

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

...

The configuration elements

...

The elements used in the above ESB configuration are explained below.

  • Proxy Service - The proxy service takes requests a request and forwards them it to the back-end service, abstracting the routing logic from the client. In this example scenario, the proxy service just forwards requests the request to the back-end service, following the Document Message EIP style

Simulating the example scenario

...

You need to set up the ESB, and the back-end service:

  1. Download the Document-Message_1.0.0.zip file, which includes the ESB configuration described above. 
  2. See Setting up the Environment for instructions on setting up the ESB and the back-end service.

    Info

    When you set up the environment, note that you only need to start one instance of the back-end service (Stock Quote Service) to simulate this example.

Executing the sample

Send the following Let's send a request to the ESB , by using a SOAP client: Note that the entire request will be passed to the back-end Axis2 Server, and the client will receive the response in return.

Request command: 

...

using the Stock Quote Client application. Find out more about the Stock Quote Client from the ESB documentation.

  1. Open a new terminal, and navigate to the <ESB_HOME>/samples/axis2Client/ directory. The Stock Quote client application is stored in this directory.
  2. Execute the following command to send the request to the ESB.

    Code Block
    ant stockquote -Dtrpurl=http://localhost:8280/services/DocumentMessageProxy

Analyzing the output

Stock Quote Client output: 

Standard :: Stock price = $72.78678053494932

Axis2 server console output:

When you execute the command above, the ESB first receives the message and then routes it to the back-end service (StockQuoteService). The following output will be printed on the Axis2 server's console: 

Code Block
samples.services.SimpleStockQuoteService :: Generating quote for : IBM

The generated stock quote will then be sent to the client application (Stock Quote Client). The following output will be printed on the client application's console:

Code Block
Standard :: Stock price = $72.42070059233666