This documentation is for WSO2 Enterprise Service Bus version 4.8.1 . View documentation for the latest release.

All docs This doc
Skip to end of metadata
Go to start of metadata

Objective: Demonstrate switching from HTTP to JMS.

  • Download, install and start a JMS server.
  • Configure sample Axis2 server for JMS.
  • Start the Axis2 server and deploy the SimpleStockQuoteService.
  • Configure the Synase JMS transport.
  • Start the Synapse configuration numbered 251: -sn 251
<definitions xmlns="">
    <proxy name="StockQuoteProxy" transports="http">
                <address uri="jms:/SimpleStockQuoteService?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&amp;
                <property action="set" name="OUT_ONLY" value="true"/>
        <publishWSDL uri="file:repository/samples/resources/proxy/sample_proxy_1.wsdl"/>

To switch from HTTP to JMS, edit the samples/axis2Server/repository/conf/axis2.xml for the sample Axis2 server and enable JMS, and restart the server. Now you can see that the simple stock quote service is available in both JMS and HTTP in the sample Axis2 server. To see this, point your browser to the WSDL of the service at http://localhost:9000/services/SimpleStockQuoteService?wsdl. JMS URL for the service is mentioned as below:


You may also notice that the simple stock quote Proxy Service exposed in ESB is now available only in HTTP as we have specified transport for that service as HTTP. To observe this, access the WSDL of stock quote proxy service at http://localhost:8280/services/StockQuoteProxy?wsdl.

This ESB configuration creates a Proxy Service Samples over HTTP and forwards received messages to the above EPR using JMS, and sends back the response to the client over HTTP once the simple stock quote service responds with the stock quote reply over JMS to the ESB server. To test this, send a place order request to ESB using HTTP as follows:

ant stockquote -Daddurl=http://localhost:8280/services/StockQuoteProxy -Dmode=placeorder -Dsymbol=MSFT

The sample Axis2 server console will print a message indicating that it has accepted the order as follows:

Accepted order for : 18406 stocks of MSFT at $ 83.58806051152119
  • No labels