This documentation is for WSO2 Enterprise Service Bus version 4.7.0 . View documentation for the latest release.
Skip to end of metadata
Go to start of metadata

This section describes how to configure WSO2 ESB to send messages to a JMS Queue.

Diagram 2 : 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. 

Sample code 2
<proxy xmlns="" name="StockQuoteProxy" transports="http">
            <property action="set" name="OUT_ONLY" value="true"/>
                    <address uri=""/> <!-- Specify the JMS connection URL here -->
            <property action="set" name="FORCE_SC_ACCEPTED" scope="axis2" value="true"/>
    <publishWSDL uri="file:repository/samples/resources/proxy/sample_proxy_1.wsdl"/>

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.

Example JMS connection URL for ActiveMQ
jms:/SimpleStockQuoteService?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&amp;                 java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;java.naming.provider.url=tcp://localhost:61616&amp;transport.jms.DestinationType=queue
Example JMS connection URL for WSO2 Message Broker


When entering these URLs in the management console, replace '&' character in the endpoint URL with '&amp;'

Other Configurations

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. 
<transportSender name="jms" class="org.apache.axis2.transport.jms.JMSSender"/>
  • 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. 
ant stockquote -Daddurl=http://localhost:8280/services/StockQuoteProxy -Dmode=placeorder -Dsymbol=MSFT
  • During inSequence, the OUT_ONLY property is set to true to indicate that message exchange is one-way.
  • No labels