Objective: Introduction to switching transports (JMS to HTTP/S) with.
- Start the Axis2 server and deploy the
- Download, install and start a JMS server, and configure ESB to listen on .
- Start the Synapse configuration numbered 250:
wso2esb-samples.sh -sn 250
For this example we use ActiveMQ as the JMS provider. Once ActiveMQ is installed and started you should get a message as follows:
You will now need to configure the Axis2 instance used by ESB (not the sample Axis2 server) to enable JMS support using the above provider. Refer to the Axis2 documentation on setting up JMS for more details (http://ws.apache.org/axis2/1_1/jms-transport.html). You must also copy activemq-core-5.7.0.jar, geronimo-j2ee-management_1.1_spec-1.0.1.jar, and geronimo-jms_1.1_spec-1.1.1.jar from
<ESB_HOME>/repository/components/lib to allow the ESB to connect to the JMS provider.
For a default ActiveMQ version 4.0 installation, you may uncomment the Axis2 transport listener configuration found at
You need to enable the JMS transport sender for the ESB to be able to send messages over the JMS transport. To enable the JMS transport sender, uncomment the Axis2 transport sender configuration found at
Once you start the Synapse configuration and request for the WSDL of the proxy service (http://localhost:8280/services/StockQuoteProxy?wsdl) you will notice that its exposed only on the JMS transport. This is because the configuration specified this requirement in the Proxy Service definition.
Now lets send a stock quote request on JMS, using the dumb stock quote client as follows:
On the ESB debug log, you will notice that the JMS listener received the request message as:
Now if you examine the console running the sample Axis2 server, you will see a message indicating that the server has accepted an order as follows:
In this sample, client sends the request message to the proxy service exposed in JMS in Synsape. ESB forwards this message to the HTTP EPR of the simple stock quote service hosted on the sample Axis2 server, and returns the reply back to the client through a JMS temporary queue.
It is possible to instruct a JMS Proxy Service to listen to an already existing destination without creating a new one. To do this, use the property elements on the proxy service definition to specify the destination and connection factory etc.