This page describes how to integrate WSO2 Message Broker with WSO2 Data Services Server to facilitate subscribing data services to JMS queues or topics and receiving messages from the broker. It contains the following sections:
Setting up WSO2 Message Broker
- Download and install WSO2 MB according to the instructions in Installation Guide.
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.xmlfile changing the offset value to 1. For example:
Start the Message Broker by running
<MB_HOME>/bin/wso2server.sh(on Linux) or
<MB_HOME>/bin/wso2server.bat(on Windows). Note that Message Broker must be up and running before starting the Data Services Server.
Setting up WSO2 DSS
- Download and install the WSO2 DSS binary distribution (see the installation instructions in the DSS documentation).
The unzipped DSS distribution folder is referred to as
WSO2 DSS does not have a default enabled JMS transport configuration for communicating with the Message Broker. Therefore, we need to add a
<transport receiver>block for MB 2.x.x by editing
Also, uncomment the
<transport sender>block for JMS in the same file as follows:
Create and add the following
jndi.propertiesfile into the
<DSS_HOME>/repository/conf/directory to point to the running Message Broker:
Copy the following client library JAR files from the
Important: If you are integrating with DSS version 3.0.1, replace
<DSS_HOME>/repository/components/plugins/axis2-transport-jms_1.1.0.wso2v7.jar with the one attached here. This JAR file contains JMS transport changes that affect the integration of DSS 3.0.1 with MB. Future versions of Data Services Server will have this fix built in, so replacing this JAR will be not necessary.
Once the JMS transport is enabled for DSS, it will reflect in all the services deployed in Data Services Server, which can cause an unexpected error during server start up. To prevent this error, edit and add the following parameters into the
<service> entry of
Copy the two files RDBMSSample_services.xml and RDBMSSample.dbs in this 'samples/' directory into the
Save all the files and start the DSS by running
<DSS_HOME>/bin/wso2server.sh (on Linux) or
<DSS_HOME>/bin/wso2server.bat (on Windows).
Testing the integration
Deploy a sample data_service in DSS. A JMS queue for the name of this service will be generated in the Message Broker. Publish a message to this queue and it will be received by the corresponding data_service in DSS. There can be any message processing operations performed using these messages, inside the data_service now.