Wednesday, December 12, 2012

Non-blocking data publshing for BAM/CEP

You can publish the events to BAM/CEP by using the DataPublisher. AsyncDataPublisher is enhanced version of DataPublisher which incorporates all the constructors and API of of general DataPublisher and send events asynchronously. Thats is in general data publishers, making the connection is synchronous/blocking therefore the network latency might affect the connection time and publishing efficieny. The AsyncDataPublisher connects to the receiver asynchronously and cache and re-use the stream id in efficient manner.

There are mainly three steps involved in creating the AsyncDataPublisher.

1.Create a AsyncDataPublisher Instance with any of available constructors.
Eg: AsyncDataPublisher asyncDataPublisher = new AsyncDataPublisher("url","userName", "password");

2. Add the stream definition json string which you would like to publish via the AsyncDataPublisher. You can add any number of stream definitions and any time you can include that. But make sure before you publish the event for a specific stream definition, you should include it in the AsyncDataPublisher.
    Eg: asyncDataPublisher.addStreamDefinition("stream def");
3. Start send events using the AsyncDataPublisher.
    Eg: asyncDataPublisher.publish("stream name", "stream version", metaDataObjectArray, correlationDataObjectArray, payLoadDataObjectArray );

    This will send events with additional advantage as mentioned above.

Friday, October 26, 2012

How Install the Nvidia driver in Unbuntu Lenova T520?

Recently I required to change my hard disk to a new lenova machine. I'm using ubuntu. And every thing works well after I change the hard disk, but I had a problem with my screen resolution. It was set to 4:3 and that was the maximum resolution available. It was really hard for me to work with that less resolution.

And found the reason was the driver for my display, Nvidia is not detected correctly so that I installed the Nvidia driver again in my Ubuntu machine.

The following are the steps I followed to install the Nvidia driver in my machine.

1. sudo add-apt-repository ppa:ubuntu-x-swat/x-updates 

2. sudo apt-get update

3. sudo apt-get install nvidia-current 

After installing the driver, I restarted the machine and changed the resolution (Applications -> System Tools -> System Settings -> Displays) to 16:9, and solved the resolution problem :-)

Friday, October 5, 2012

Whats is WSO2 BAM 2.0..

WSO2 BAM is a fully open source Business Activity Monitoring. Recently WSO2 BAM 2.0 has been released which a complete revamp of WSO2 BAM 1.x.

It's targeted to monitor not-only WSO2 servers but also other third party servers and applications and Key performance Indicators (KPI) and also providing high scalable storage of data via Cassandra and high business data analytics capability through Apache Hive & Hadoop. Also it has very high performance of data capture by using thrift. WSO2 BAM is very scalable, such as you can scale individual components of BAM according to your requirement. If you need high performance for data storage you can only scale the Cassandra storage as multi-node cluster, and if you target to do more analytics in your captured data then you can scale and have a hadoop cluster which makes your analytics faster. WSO2 BAM also has attractive pluggable dashboards, where some of them are in-built by default and some of them are released by separate toolboxes.WSO2 BAM enables you to not only use the default dashboards but also you can write your own gadgets or visualizing engines to plug and view the data.

The below diagram shows the architecture of WSO BAM.

  1. Event/Data Receiving
    You can publish any data to BAM via data agents. Already there are data agents available for WSO2 Servers in order to publish the Service Statistics Monitoring, and WSO2 ESB for Mediation Statistics Monitoring and Activity Mediation Monitoring. Similar to this you write a simple java application to publish your third-party events through thrift as described in And also you can publish the events via REST api to BAM as described in

  2. Data Dumping in Cassandra
    After receiving the events/data in BAM, it immediately flush the data Cassandra database. Cassandra data base provides high scalability and it's very suitable to store huge amount of data with hight performance.

  3. Running business analytics
    Analyzer framework consists of Apache Hive and Hadoop. Hive is a data warehouse system for Hadoop that facilitates easy data summarization, ad-hoc queries, and the analysis of large datasets stored in Hadoop compatible file systems. Hive provides a mechanism to project structure onto this data and query the data using a SQL-like language called HiveQL. At the same time this language also allows traditional map/reduce programmers to plug in their custom mappers and reducers when it is inconvenient or inefficient to express this logic in HiveQL.
You can access the captured data which is stored in Cassandra and run the analytics on those data via writing the hive scripts. You can find sample hive scrips on WSO BAM samples in and more hive related queries can be found in

  1. Storing the result in JDBC storage
    After running the business analytics in you captured big data, you can store the summarized results in JDBC storage such as MySQL, H2 Database, Oracle, etc. This facilitates to plug any external reporting engine or preferred dashboard gadgets. In WSO2 BAM samples we have written the summarized data into H2 database as it's the default database used. You can find more details of writing the results in the JDBC storage in

  1. Visualization
    Visualization of the data done by WSO2 Jaggery Framework . This data also can be visualized via writing google gadgets also. You can see the sample gadgets created in WSO2 KPI Monitoring sample in And also there are dashboards which includes specially designed gadgets for Service statistics Monitoring and WSO2 ESB montitoring. 
There is already available reporting using the jasper reporting available in

These all phases of WSO2 BAM provides to privilege of monitoring your own data and visualize your business aspects.

Enjoy WSO2 BAM!! :)

Wednesday, October 3, 2012

BAM Toolboxes - Quick Deployment for your Scenario

I have written BAM toolboxes, which is an installable archive in WSO2 BAM. This provides you a quick deployment of your scenario in WSO2 BAM in few seconds.

WSO2 BAM has importantly three components,

      1. Receiving Data/Events and Storage
        - This is the main interface which BAM interacts with other servers. That is you can use WSO2 servers/ any third part servers/application and send the events/data to BAM. I'll include how you can send events to BAM in a separate article.
      2. Analytics
        - This component analyzes the data that is received in part-1, and produces some useful information out of your data. Apache Hive and hadoop are used in this segment to analyze the big data and scale according to the requirement.
      3. Presentation
        There are attractive dashboards, gadgets, reports can be produced in this segment out of the data you have summarized in step-2.

In reality during the testing stage, you might be writing your own customized artifacts in all three above components. The toolbox provides you the flexibility of combining all three as a single artifact and install in WSO2 BAM, such that all the components as mentioned above can come in to the BAM within few seconds, rather manually setting up the environment in production setup.

And also WSO2 BAM will be continuously releasing new toolboxes which includes different use cases such that you can just install that in WSO2 BAM and try out.

You can see how you can install the toolboxes in WSO2 BAM in

And also you can find how you can create your own toolbox in,

WSO2 BAM 2.0 - New Begining ...

WSO2 has released WSO2 BAM2.0 with WSO2 CARBON 4.0.1 release on September 8th 2012.

The WSO2 Business Activity Monitor (WSO2 BAM) is an enterprise-ready, fully-open source, complete solution for aggregating, analyzing and presenting information about business activities. The aggregation refers to collection of data, analysis refers to manipulation of data in order to extract information, and presentation refers to representing this data visually or in other ways such as alerts. The WSO2 BAM architecture reflects this natural flow in its design.

Since all WSO2 products are based on the component-based WSO2 Carbon platform, WSO2 BAM is lean, lightweight and consists of only the required components for efficient functioning. It does not contain unnecessary bulk, unlike many over-bloated, proprietary solutions. WSO2 BAM comprises of only required modules to give the best of performance, scalability and customizability, allowing businesses to achieve time-effective results for their solutions without sacrificing performance or the ability to scale.

The product is available for download at:

The documentation is available at:

BAM 2.0 has monitoring services, by using the Service Statistics Toolbox found in Via this you can monitor request, response, fault count, response time, etc for a hosted services.

WSO2 BAM 2.0.1 which includes attractive dashboards for WSO2 ESB monitoring will be released soon.

Friday, May 18, 2012

Useful commands in OSGI

OSGI framework enables to build true modular system in java. It defines a way to create true bundles and a way those communicate at run time. Here generally the modules are called as bundles and another advantage is we can install and unistall a bundle in the runtime without restarting the JVM.
Here the unit of information hiding is package in a bundle, ie there can be certain packages made visible to other bundles in the runtime and certain can he hidden.

This post is mainly targeted to work an debug wso2 server. Therefore in the run time there is requirement interact with OSGI framework. I'm listing some useful commands here.

  1. -DosgiConsole
    To enable the OSGI console in server startup
  1. install file:<path to file>
    To install a bundle in the run time

  2. ss <some_part_of_bundle_name>
    List the bundle state and bundle id with bundle symbolic name

  3. start <bundle id>
    when you just run the install command, it won't start the bundle. For that you should execute start command also. You can notice this in the ss command.

  4. stop <bunle id>
    This command will put the bundle from ACTIVE to INSTALLED state.

  5. uninstall <bundle_id>
    This will uninstall the bundle from the OSGI framework

  6. packages <package_name>
    You can see the packages visible to the OSGI framework with its versions and exporting bundles.
    Eg: packages
  1. b <bundle id>
    lists the bundle information, such as exported and imported packages. If you have same package exported by multiple bundles with different versions, then you can view what version of package being used in the run time in the specified bundle id.

  2. diag <bundle id>
    This command lists about the status of the bundle and lists if any unresolved packages exists for that particular bundle.
  1. ls
    list down all the service components found in this runtime along with their component ID and life-cycle status. Here you can see whether a bundle in satisfied state or unsatisfied state. For example if a bundle expects a osgi service, and if it's not available in the osgi at run time the bundle will be unsatisfied sate.
  2. enable <componentID>
    enabling service components

  3. comp <componentID>
    Use this command to find unsatisfied services of the given component, which prevent it from going it to satisfied state. 

  4. services
    list down all the services in the runtime including services provided by the system bundle. You can use simple filters to narrow down your list.
  1. disable <componentID> 
    disabling component  given by the component ID

Hope the above commands helps you to work with osgi framework. Have fun with osgi! :-)

Friday, April 27, 2012

I'm in WSO2..

Soon after I complete B.Sc in Engineering in UoM, I joined WSO2 in December 1st 2011 as a Software Engineer. A next major chapter unfolds in my life from WSO2. It's really wonderful company to work in Sri Lanka. I was assigned to work in BAM(Business Activity Monitoring) which is one of the most expected product in WSO2. I'll write a separate post about WSO2 BAM soon.

WSO2 is a Open source Company, ie, all WSO2 products are 100% open source and released under Apache Licence Version 2.0. It's the only company which provides the complete open source middleware platform. Fully cloud-native, the WSO2 middleware platform is also the only open source platform-as-a-service for private, public and hybrid cloud deployments available today. WSO2 has nearly 15 different kind of products such as WSO2 BAM (Business Activity Monitoring), WSO2 ESB(Enterprise Service Bus), WSO2 IS (Identity Server), WSO2 DSS (Data Services Server), etc which can provide complete solution to enterprise applications. And the count of products doubles to 30 with PaaS (Platform as a Service), ie all WSO2 products are available in WSO2 Stratos. You can visit to WSO2 from and contact via for any queries.

WSO2 uses SOA (Service oriented Architecture) throughout it's platform. The WSO2 Carbon, is the core of all WSO2 products. Each products are composed it's respective features. And by installing the respective features of the product on top of carbon will give a new product. And the all products and platform consists of totally independent components where as it can be installed and uninstalled independently. This is achieved through OSGI (Open Services Gateway Initiative) framework. I'll write a separate post on how you can work with OSGI framework.

WSO2 gives me an opportunity to work with lots of products and technologies. From the day one in WSO2, I'm coming across new things and learning continuously. I'm sure WSO2 is going to a big turning point in my life time!!


First of all I would like to welcome to my blog post.. :-)

I would like to share about my thoughts and learnings in my career path.

I'm Sinthuja Rajendran from Sri Lanka. I started my schooling in C/Ramanathan Hindu Ladies' College. Those days are the golden memories of my life time. I was selected to University of Moratuwa after my A/L's. Then again after the Level-1 exams, I selected the Electronics & Telecommunication Engineering as my preferred field. And also I was able to complete the BCS (British Computer Society) Professional examinations. And now I have passed out from the university with 1st class and working in WSO2 as a Software Engineer.

I feel it's a great pleasure to study in UoM. I will proudly say my university life has moulded me to face this competitive world with lots of confidence, it helped me to identify my potential and what I should improve. And also UoM gave me the chance to get in to the world of competition with different kind of people and now it's my turn to show my capabilities and climb up in the career ladder, hope I'll succeed.

In my blog I'm going to post new things I learn, about the things that I have already learned and feel important to share and the my own ideas and thoughts. Hope my blog posts will interesting and help you.

Keep on sharing your comments to my posts! :-)