...
- Download and install WSO2 ESB according to the instructions in Getting Started. The unzipped ESB distribution folder is referred to as
ESB_HOME
. Enable the JMS transport of WSO2 ESB to communicate with the Message Broker by editing the
<ESB_HOME>/repository/conf/axis2/axis2.xml
file. Find a commented<transport receiver>
block for MB and uncomment it as shown below.Code Block language html/xml <!--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> </transportReceiver>
Also, uncomment the
<transport sender>
block for JMS in the same file as shown below.Code Block language html/xml <transportSender name="jms" class="org.apache.axis2.transport.jms.JMSSender"/>
- Copy the following jar files from the
<MB_HOME>/clent-lib
folder to the<ESB_HOME>/repository/components/lib
folder.andes-client-23.61.21.jar
geronimo-jms_1.1_spec-1.1.0.wso2v1.jar
org.wso2.securevault-1.0.0-wso2v2.jar
- Open the
<ESB_HOME>/repository/conf/
JNDI.proerties
file and make a reference to the running Message Broker as shown below.Use
carbon
as the virtualhost. Define a queue calledJMSMS
. Comment out the topic since it is not needed for this scenario. However, in order to avoid getting thejavax.naming.NameNotFoundException: TopicConnectionFactory
exception during server startup, make a reference to the Message Broker from theTopicConnectionFactory
as well.Anchor jndi jndi Code Block # 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
Info The connection factory specifies the URL to be used by a client using WSO2 MB in order to connect to it. 5673 in this example is the port listening for messages on TCP when the AMQP transport is used. This port changes depending on the port offsets done in different scenarios. See Configuring a Client to Access Broker When Port Offset is Change for more information.
Tip If you want to create a queue that is specific to a particular tenant (e.g., a tenant with
test.com
domain), the following is required.- The connection factory entries should have the tenant's credentials instead of the super tenant's credentials.
- The queue name should have the tenant's domain as a prefix as shown below.
test.com/StockQuotesQueue
See Managing Tenant-specific Subscriptions for detailed information.
- Start WSO2 ESB by running
<ESB_HOME>/bin/wso2server.sh
(on Linux) or<ESB_HOME>/bin/wso2server.bat
(on Windows).
Now you will have both the Enterprise Service Bus and the Message Broker running. - We need some background services to be available for testing purposes. Therefore, run an ANT task to deploy the
SimpleStockQuoteService
in the simple axis2server as follows.Anchor Backend Backend
...