This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
Configure with WSO2 Message Broker
This page walks you through the steps to follow when configuring WSO2 ESB's JMS transport with WSO2 Message Broker (WSO2 MB).
Note
When you configure WSO2 ESB’s JMS transport with WSO2 MB, the recommended version of WSO2 MB to be used is WSO2 MB 3.0.0. We do not recommend the use of WSO2 MB 2.2.0 or lower.
Follow the steps below to configure the ESB's JMS transport with WSO2 MB 3.0.0
Setting up WSO2 MB
Download and install WSO2 MB. For instructions on how to download and install WSO2 MB, see Getting Started with WSO2 MB.
The unzipped WSO2 MB distribution folder will be referred to as<MB_HOME>throughout the documentation.Open a command prompt (or a shell in Linux) and go to the
<MB_HOME>\bindirectory.Start the Message Broker by executing
sh wso2server.sh(on Linux/OS X) orwso2server.bat(on Windows).
Setting up WSO2 ESB
If you have not already done so, see Getting Started with WSO2 ESB for details on installing and running WSO2 ESB.
To enable the JMS transport of WSO2 ESB to communicate with the Message Broker, edit the
<ESB_HOME>/repository/conf/axis2/axis2.xmlfile, find the commented<transport receiver>block and uncomment it as shown below.<!--Uncomment this and configure as appropriate for JMS transport support with WSO2 MB 2.x.x --> <transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener"> <parameter name="myTopicConnectionFactory" locked="false"> <parameter name="java.naming.factory.initial" locked="false">org.wso2.andes.jndi.PropertiesFileInitialContextFactory</parameter> <parameter name="java.naming.provider.url" locked="false">repository/conf/jndi.properties</parameter> <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">TopicConnectionFactory</parameter> <parameter name="transport.jms.ConnectionFactoryType" locked="false">topic</parameter> </parameter> <parameter name="myQueueConnectionFactory" locked="false"> <parameter name="java.naming.factory.initial" locked="false">org.wso2.andes.jndi.PropertiesFileInitialContextFactory</parameter> <parameter name="java.naming.provider.url" locked="false">repository/conf/jndi.properties</parameter> <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter> <parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter> </parameter> <parameter name="default" locked="false"> <parameter name="java.naming.factory.initial" locked="false">org.wso2.andes.jndi.PropertiesFileInitialContextFactory</parameter> <parameter name="java.naming.provider.url" locked="false">repository/conf/jndi.properties</parameter> <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter> <parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter> </parameter> </transportReceiver>Also, uncomment the following
<transport sender>block for JMS in the same file:<!-- uncomment this and configure to use connection pools for sending messages> <transportSender name="jms" class="org.apache.axis2.transport.jms.JMSSender"/-->Copy the following JAR files from the
<MB_HOME>/clent-libdirectory to the<ESB_HOME>/repository/components/libdirectory.andes-client-3.0.1.jargeronimo-jms_1.1_spec-1.1.0.wso2v1.jarorg.wso2.securevault-1.0.0-wso2v2.jar
Open
<ESB_HOME>/repository/conf/jndi.propertiesfile and make a reference to the running Message Broker as specified below:Use carbon as the virtual host.
Define a queue named
JMSMSComment out the topic, since it is not required in this scenario. However, in order to avoid getting the
javax.naming.NameNotFoundException:TopicConnectionFactoryexception during server startup, make a reference to the Message Broker from theTopicConnectionFactoryas well.For example:
# register some connection factories # connectionfactory.[jndiname] = [ConnectionURL] connectionfactory.QueueConnectionFactory = amqp://admin:admin@clientID/carbon?brokerlist='tcp://localhost:5673' connectionfactory.TopicConnectionFactory = amqp://admin:admin@clientID/carbon?brokerlist='tcp://localhost:5673' # register some queues in JNDI using the form # queue.[jndiName] = [physicalName] queue.JMSMS=JMSMS queue.StockQuotesQueue = StockQuotesQueue
Ensure that WSO2 Message Broker is running, and then open a command prompt (or a shell in Linux) and go to the
<ESB_HOME>\bindirectory.Start the ESB server by executing sh wso2server.sh (on Linux/OS X) or wso2server.bat (on Windows).
Now you have instances of both WSO2 Message Broker and WSO2 ESB configured and running.