Thursday, September 26, 2013

Using PostgreSQL with WSO2 BAM

WSO2 Business Activity Monitor (BAM) can be used to address monitoring requirements in business activities and processes. It supports aggregating, analyzing and presenting information about business activities.

WSO2 BAM architecture is designed to handle these steps through its different modules.  Data Receivers in WSO2 BAM receive data and store them in a Cassandra data store. The Analyzer Engine will run analytics according to defined Hive queries and stores the result in a RDBMS data store. Finally the analyzed data will be fetched from the data store and shown in dashboards or reports.

This post will show how to integrate PostgreSQL into WSO2 BAM, which could be used to store analyzed data.

Step 1:
Install PostgreSQL and create a database named "wso2bam_postgresql".
In Ubuntu, 
sudo apt-get install postgresql

Then log into PostgreSQL through psql command
sudo -u postgres psql

Then enter the following command to create the database.
create database wso2bam_postgresql;

You can view the existing databases using \l command

Step 2:
Download PostgreSQL JDBC driver and place it in [BAM_HOME]/repository/components/lib/ folder.

Step 3:
Define the PostgreSQL data source by adding the following configuration to
[BAM_HOME]/repository/conf/datasources/master-datasources.xml file.

   <description>The datasource used for analyzer data</description>
   <definition type="RDBMS">
         <validationQuery>SELECT 1</validationQuery>
Step 4:
Start the BAM server and test the data source connection by going to Configure > Data Sources in the Management Console and select the added data source.

Then click on "Test Connection" button and it should give a message saying "Connection is healthy".

Now you can use WSO2BAM_POSTGRESQL datasource from BAM.


Post a Comment