Sunday, February 26, 2012

Apache BarCamp Colombo


We just had a wonderful Apache BarCamp here in Colombo at the UCSC Auditorium. The main motivation behind this activity is to promote open source contribution and give an inside into "Apache Way" of software development. Here I'm sharing some bits and pieces that stick to my mind.

The session kicked off with an excellent keynote by Dr. Sanjiva Weerawarana, where he was talking on the interesting point on how Sri lanka eventually became the third largest contributor to Apache Software Foundation (ASF). There he mentioned how they initiated the first ever Sri Lankan open source development at a UCSC lab with four C++ programmers and how they were able to come up with AxisC++ which was then been shipped by IBM.

Following Sanjiva, Ross Gardler took the floor and went on explaining “The Apache Way”, from what ASF is and how we could start and become a long term contributor. He clarified all important small words thats binds ASF like, Meritocracy where the action should speak louder than words, Lazy Consensus where “when you are convinced that you know what the community would like to see happening you can simply assume that you already have its support unless someone says otherwise” and the use of -1's where one should be opposing the arguments with valid points.

The final key note was by Nick Burch, who did a wonderful job sharing his experience on what a pain he went through to apply his first patch, explaining how open source communities work and why we should not take things personally when they did not apply your patch or response to your queries. He gave a strong point on how developers might be busy on some other projects and in open source if you want things to happen the way you want you have to "Just F****** Do It" (JFDI). He ended up his great talk with the final touch by saying how open source development could be very fun and how it might even end up as an addiction.

With all these three key notes we too had two other sessions where in one, Sagara Gunathunga was presenting they key steps that you will need when you "Find your way to Apache contribution" by giving some clear idea for all newbies to get a kickoff start.

Finally we had an interesting session on  "How to prepare to Google Summer of Code 2012 with Apache projects" motivating young undergraduates to take off the fear of open source and accept the challenge on doing GSOC 2012! Thanks Pradeeban for presiding the sessions and Nirmal and Eranda for sharing your experience with me to all the enthusiastic ordinance.

We thank WSO2, Vertusa, ASF and UCSC for your help in sponsoring this great event.



Sunday, February 19, 2012

Installing Apache Thrift in Ubuntu


Apache Thrift is a RPC framework for scalable cross-language services development which in simpler words allows easy exchange of data such as variables, objects between applications written in different languages. Thrift offers seamless cross language serialization between languages like C++, Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa, Smalltalk and OCaml, through Code generation. The advantage of Thrift is that it’s faster than using SOAP since it’s using a binary protocol.

For better understanding of Thrift's architecture which consists of Transports, Protocols and Processors I recommend you to go through the paper I found [1].
Thrift was initially developed at Facebook, and now open sourced as an Apache project. Since I found Thrift is less documented, in this post I'll try to walk through the installation steps in Ubuntu.

I have tested this on Ubuntu 11.11 and 12.04

To install Thrift

Step 1.
First install
sudo apt-get install libboost-dev libboost-test-dev libboost-program-options-dev libevent-dev automake libtool flex bison pkg-config g++ libssl-dev

Step 2.
Then Download tar.gz archive from the download site, decompress archive in your home directory:
tar -xvzf thrift-0.8.0.tar.gz

Step 3.
Go to the installation root directory  and run
$ ./configure

Step 4.
A the end of the output you will find something like this

thrift 0.8.0
Building code generators ..... :
Building C++ Library ......... : yes
Building C (GLib) Library .... : no
Building Java Library ........ : yes
Building C# Library .......... : no
Building Python Library ...... : yes
Building Ruby Library ........ : no
Building Haskell Library ..... : no
Building Perl Library ........ : no
Building PHP Library ......... : no
Building Erlang Library ...... : no
Building Go Library .......... : no
Building TZlibTransport ...... : yes
Building TNonblockingServer .. : yes
Using javac .................. : javac
Using java ................... : java
Using ant .................... : /usr/bin/ant
Using Python ................. : /usr/bin/python

Check whether the libraries for your development environment have been code generated. If something is missing skim through the output of configure to find the missing component and install that, and then again run step 3.

Step 5.
Finally from the same directory run
$ make

Step 6.
Now run
$ sudo make install

Now your done

To check whether Thrift is working, run;
$ thrift -version

[1] http://thrift.apache.org/static/thrift-20070401.pdf

Hot deployment of CEP query configuration in WSO2 CEP

WSO2 CEP is an open source CEP server released under Apache License v2.0

WSO2 CEP has an added advantage of flexible integration, such as enabling it to integration with Enterprise Service Buses like WSO2 ESB which can send events across transports into various streams. WSO2 CEP can also be used with Message Brokers (E.g. WSO2 MB) to process messages of the topics CEP has subscribed and publishing back the matching occurrences in MB. Further this can also be used with WSO2 Business Activity Monitor to monitor actionable events on the fly and report them.

WSO2 CEP is designed to support multiple open source CEP engines, with out-of-the-box support for Drools Fusion and EsperTM.

WSO2 CEP's back-end CEP engine, query configuration, and all input and output mappings are represented as buckets. Here we create buckets for each of our use-cases.

In earlier versions of WSO2 CEP cep-config.xml file is the only mean of deploying cep buckets via configuration. Here the configurations will be added only at server start up. From WSO2 CEP 4.0.0 release writing buckets and deploying them in the Server has become very easy via the Axis2 hot deployment.

For hot deployment we just need to write an xml containing the bucket configuration and drop that in the CARBON_HOME/repository/deployment/server/cepbuckets/

Here each bucket configuration file can contain configuration of a single CEP bucket.
This file need to have a .xml extension and follow the cep-config.xsd.

E.g.

<bucket xmlns="http://wso2.org/carbon/cep" .... >
         .... configuration....
</bucket >