This section describes how to configure the WSO2 ESB's JMS transport with WSO2 Message Broker (MB). It facilitates message brokering needs of the ESB and helps implement the store and forward messaging pattern.
Follow the instructions below to set up WSO2 MB and WSO2 ESB.
Setting up WSO2 Message Broker
1. Download and install WSO2 MB binary distribution. Instructions can be found in the Installation Guide in the Message Broker documentationhe unzipped MB distribution folder will be referred to as <MB_HOME>.
It is not possible to start multiple WSO2 products with their default configurations simultaneously in the same environment. Since all WSO2 products use the same port in their default configuration, there will be port conflicts. Therefore, to avoid port conflicts, apply a port offset in <MB_HOME>/repository/conf/carbon.xml file by changing the offset value to 1. For example,
2. WSO2 MB uses a Cassandra server that is bundled with it by default for storage. As the Message Broker's port offset is changed by 1 above, change the Cassandra port accordingly by opening <MB_HOME>/repository/conf/advanced/qpid-virtualhosts.xml file and increasing the port by 1. In this case, it will be 9161 (Default 9160 + 1).
This section uses the embedded Cassandra server for configuration. However, in a production setup, using an external Cassandra server that is capable of handling large volumes of queues is recommended. For information on setting up WSO2 MB with an external server, see the Deployment Guide in the Message Broker Documentation
When an external Cassandra server is used, point the Message Broker to it by editing the value of the <connectionString> accordingly.
3. The default message batch size for browser subscriptions of Message Broker 2.0.1 is a very low value like 2. Increase it to a larger value by adding the following parameter as an immediate child of the root <broker> element to <MB_HOME>/repository/conf/advanced/qpid-config.xml file.
4. Start the Message Broker by running,
- <MB_HOME>/bin/wso2server.sh (on Linux)
- <MB_HOME>/bin/wso2server.bat (on Windows)
Setting up WSO2 ESB
1. If you have not already done so, see Getting Started for details on installing and running WSO2 ESB.
2. 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-out <transport receiver> block for MB 2.x.x and uncomment it.
Uncomment the <transport sender> block for JMS in the same file as follows:
3. Copy the following JAR files from <MB_HOME>/clent-lib folder to <ESB_HOME>/repository/components/lib folder. They are client libraries required from Message Broker to ESB.
4. Open <ESB_HOME>/repository/conf/JNDI.properties file and point to the running Message Broker.
- Use carbon as the virtualhost.
- Comment out the topic, as it is not needed. But, in order to avoid the error javax.naming.NameNotFoundException: TopicConnectionFactory during server startup, also point TopicConnectionFactory to the Message Broker.
5. Ensure that WSO2 Message Broker is running, and then start WSO2 ESB by running one of the following commands:
- <ESB_HOME>/bin/wso2server.sh (on Linux)
- <ESB_HOME>/bin/wso2server.bat (on Windows)
You now have instances of WSO2 Message Broker and WSO2 ESB configured and running. Next, refer to section JMS Usecases for implementation details of various sample scenarios.