This section describes how to configure WSO2 ESB to send messages to a JMS Queue.
Diagram 1 : Simple HTTP to JMS proxy service
The following example code shows the configuration of ESB proxy service to accept messages via HTTP and send them to JMS queue.
During inSequence, the OUT_ONLY property is set to true to indicate that message exchange is one-way.
JMS Connection URL
To send a message to a JMS queue, we define a JMS connection URL (line numbers 7 in the configuration above) as the URL of the endpoint, which will be invoked via the send mediator.
You can define a JMS queue name and connection factory parameters in the JMS connection URL. Values of connection factory parameters depend on the type of the JMS broker. Listed below are examples of how the JMS connection URL can be defined for WSO2 Message Broker and for ActiveMQ.
When entering the following JMS connection URLs in the Management Console, be sure to replace the '
&' character in the endpoint URL with '
&' to avoid the following exception:
Example JMS connection URL for ActiveMQ
Example JMS connection URL for WSO2 Message Broker
In addition to configuring the ESB proxy service as shown above, follow the steps below.
- To enable JMS sender in the ESB, un-comment following line in <ESB_HOME>/repository/conf/axis2/axis2.xml.
- To enable JMS listeners in back-end axis2 services, edit <ESB_HOME>/samples/axis2Server/repository/conf/axis2.xml file and configure JMS listener as explained section Setting up the JMS Listener.
- To send an HTTP message to ESB proxy service, execute the following command from <ESB_HOME>/sample/axis2Client.
- During inSequence, the OUT_ONLY property is set to true to indicate that message exchange is one-way.