This documentation is for WSO2 ESB version 4.0.3. View documentation for the latest release.

Sample 12 One Way Messaging fireAndForget through ESB

Objective: To demonstrate one way messaging / fireAndForget through ESB.

Prerequisites
  • Start the Axis2 server and deploy the SimpleStockQuoteService (Refer steps above).
  • Start the Synapse configuration numbered 1: wso2esb-samples -sn 1.

This example invokes the one-way placeOrder operation on the SimpleStockQuoteService using the custom client which uses the Axis2 ServiceClient.fireAndForget() API. To test this, use ant -Dmode=placeorder... and you will notice the one way message flowing through ESB into the sample Axis2 server instance, which reports the acceptance of the order as follows:

ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/ -Dmode=placeorder
SimpleStockQuoteService :: Accepted order for : 7482 stocks of IBM at $ 169.27205579038733

If you send your client request through TCPmon, you will notice that the SimpleStockQuoteService replies to ESB with a HTTP 202 reply and that ESB in-turn replies to the client with a HTTP 202 acknowledgement.