This documentation is for WSO2 Enterprise Integrator version 6.2.0 . View documentation for the latest release in the 6.x.x family and the latest release in the 7.x.x family.

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

This section describes how to configure the ESB Profile of WSO2 Enterprise Integrator (WSO2 EI) to send messages to a JMS Queue.

 

Follow the steps below to configure the ESB Profile of WSO2 EI to accept messages via HTTP, and send them to JMS queue.  

  1. Configure the ESB Profile of WSO2 EI with Apache ActiveMQ and set up the JMS Sender. For instructions, see Configure with ActiveMQ. 

  2. Create a proxy service with the following configuration. To create a proxy service using Tooling, see Working with Proxy Services via Tooling.

    See below, for details on how to define a JMS endpoint in the proxy configuration.

    <proxy xmlns="http://ws.apache.org/ns/synapse" name="StockQuoteProxy" transports="http">
        <target>
            <inSequence>
                <property action="set" name="OUT_ONLY" value="true"/>
                <send>
                    <endpoint>
                        <address uri=""/> <!-- Specify the JMS connection URL here -->
                    </endpoint>
                </send>
            </inSequence>
            <outSequence/>
        </target>
        <publishWSDL uri="file:samples/service-bus/resources/proxy/sample_proxy_1.wsdl"/>
    </proxy>

    Within the inSequence, the OUT_ONLY property is set to true to indicate that the message exchange is one-way.

  3. Send a message to the ESB by executing the following command from the <EI_HOME>/samples/axis2Client folder.


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

    You can view the ActiveMQ queue by accessing the ActiveMQ management console using the URL http://0.0.0.0:8161/admin and using admin as both the username and password. 

JMS Connection URL

To send a message to a JMS queue, you should define a JMS connection URL (line numbers 7 in the configuration above) as the URL of the endpoint, which should 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 when you use the Message Broker Profile or when you use ActiveMQ.

Note

When entering the following JMS connection URLs in the Management Console, be sure to replace the '&' character in the endpoint URL with '&amp;' to avoid the following exception:

com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '=' (code 61); expected a semi-colon after the reference for entity 'java.naming.factory.initial' at [row,col {unknown-source}
Example JMS connection URL when you use ActiveMQ
jms:/SimpleStockQuoteService?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:61616&transport.jms.DestinationType=queue
Example JMS connection URL when you use the Message Broker Profile
jms:/StockQuotesQueue?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.wso2.andes.jndi.PropertiesFileInitialContextFactory&java.naming.provider.url=conf/jndi.properties&transport.jms.DestinationType=queue
  • No labels