This sample demonstrates how one-way message bridging from JMS to HTTP can be done using the inbound JMS endpoint of the ESB. The JMS inbound protocol implementation in the ESB requires an active JMS server instance to receive the messages that will be consumed by the ESB. This sample uses ActiveMQ as the JMS server. If you are using WSO2 Message Broker as your JMS server, see Sample 901.
- Download and set up Apache ActiveMQ. Instructions can be found in section Installation Prerequisites .
Copy the following client libraries from theActiveMQ 5.8.0 and above
<AMQ_HOME>/libdirectory to the
Earlier version of ActiveMQ
Building the sample
The XML configuration for this sample is as follows:
This configuration file
synapse_sample_901.xml is available in the
To build the sample
Start the ESB with the sample 901 configuration. For instructions on starting a sample ESB configuration, see Starting the ESB with a sample configuration.
The operation log keeps running until the server starts, which usually takes several seconds. Wait until the server has fully booted up and displays a message similar to "WSO2 Carbon started in n seconds."
Start the Axis2 server. For instructions on starting the Axis2 server, see Starting the Axis2 server.
Deploy the back-end service SimpleStockQuoteService. For instructions on deploying sample back-end services, see Deploying sample back-end services.
Executing the sample
To execute the sample client
- Log on to the ActiveMQ console using the http://localhost:8161/admin url.
- Browse the queue
ordersQueuelistening via the above endpoint.
Add a new message with the following content to the queue:
Analyzing the output
You will see that the JMS endpoint gets the message from the queue and sends it to the stock quote service.