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. However, in a production setup, using an external Cassandra server that is capable of handling large volumes of queues is recommended. When an external Cassandra server is used, point the Message Broker to it by editing the value of the <connectionString> accordingly. For information on setting up WSO2 MB with an external server, see the Deployment Guide in the Message Broker Documentation
3. The default message batch size for browser subscriptions of Message Broker is 200. If needed, you can increase it to a larger value by setting the following property in the <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.