Monday, July 13, 2009

A Simple Savan Enabled Publish-Subscribe Environment


This is a guide to create a simple publisher subscriber service environment using Apache Savan.

Step 1 : Setting up the environment
Before being able to run this example you need to do some steps to configure the environment. They are...
  • Setup Java
  • Install Apache Axis 2
  • Install Maven
  • Install Apache Ant
Please check here to get more information about these steps.

Step 2 : Build the sources
Download the source code from here.
Extract it.
Go to the \Savan\Savan Source folder using the command prompt.
Execute the following command. (mvn clean install)
Wait until all the sources are built successfully.
Go to the \Savan\Savan Source\modules\samples\eventing folder using the command prompt.
Execute the following command. (ant deploy)
Go to your AXIS2_HOME\lib folder.
Copy all the files in the AXIS2_HOME\lib folder to the \Savan\SavanTester\lib folder.

Step 3 : Configure the example
Open the \Savan\SavanTester\configuration.xml file.
Do the following changes.
Enter the IP adress of the Axis2 server, at the "serverIP" entry. (for localhost enter 127.0.0.1)
Enter the port number of the Axis2 server, at the "port" entry. (most of the time this is 8080)
Enter the path to the axis2.xml file in the AXIS2_HOME\conf folder, at the "conf" entry. (e.g. C:\axis2-1.4\conf\axis2.xml)
Enter the path to the repository folder in the AXIS2_HOME directory, at the "repo" entry. (e.g. C:\axis2-1.4\repository)

Step 4 : Run the example
Start the Axis2 server. For this go to the \AXIS2_HOME\axis2-1.4\bin folder using the command prompt and execute the following command. (axis2server.bat)
Run the SavanTester.jar file in the \Savan\SavanTester folder.
You will see the following screen.

Step 5 : Using the application
Start playing with it.
There are three publishers and three subscribers.
Use the buttons in the middle to subscribe or unsubscribe from any service.
After you have subscribed to some services you can fire a publishing event using the buttons on the top.
Keep your eye on the Axis2 console for information regarding subscriptions.
Enjoy.

Wednesday, July 8, 2009

Building Apache Savan


This is a step by step guide to build Apache Savan in windows and run a sample application using Apache Savan.

Step1: Setting up the environment
To build Apache Savan you need several other components installed in your system. Follow the steps to setup the basic environment.

Setup JAVA
Create an environment variable called JAVA_HOME and give it the path of your JDK installation. (e.g. C:\Program Files\Java\jdk1.6.0_14)
Also add the Java bin folder to the Windows Path system environment variable. (e.g. C:\Program Files\Java\jdk1.6.0_14\bin)

Install Apache Axis2
Savan is module created on top of Apache Axis2. So you need to setup Axis2 in order to run Savan.
You can dowload the Axis2 components from here.
Download both "Standard Binary Distribution" and the "WAR" distribution.
Extract the "Standard Binary Distribution" and add its path to Windows Environment Variables.
In order to do this create an environment variable called AXIS2_HOME and give it the path of your Axis2 installation. (e.g. F:\Programs\Java\Axis\AXIS2_HOME\axis2-1.4.1)
Also add the Axis2 bin folder to the Windows Path system environment variable. (e.g. F:\Programs\Java\Axis\AXIS2_HOME\axis2-1.4.1\bin)

Install Apache Tomcat Server
This helps to easily customize the Axis2 server.
You can get the Tomcat installer from here.
Install it and then copy the Axis2.war file in to the webapps folder of Apache Tomcat. (i.e. C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps)
Then start the Tomcat Server.
Open your web browser and go to http://localhost:8080/axis2/.
If the Axis2 installation is successful you will be directed to the Axis2 user interface.

Install Maven
Maven is needed to build the Apache Savan source.
You can get the Maven from here.
Extract the zip file and add Maven to the windows environment variables.
In order to do this create an environment variable called MAVEN_HOME and give it the path of your Maven installation. (e.g. F:\Programs\Java\Maven\MAVEN_HOME\apache-maven-2.0.10)
Also add the Maven bin folder to the Windows Path system environment variable. (e.g. F:\Programs\Java\Maven\MAVEN_HOME\apache-maven-2.0.10\bin)

Install Apache Ant
Ant is needed to build the Apache Savan sample application.
You can get the Ant from here.
Extract the zip file and add Ant to the windows environment variables.
In order to do this create an environment variable called ANT_HOME and give it the path of your Ant installation. (e.g. F:\Programs\Java\Apache Ant\ANT_HOME\apache-ant-1.7.1)
Also add the Ant bin folder to the Windows Path system environment variable. (e.g. F:\Programs\Java\Apache Ant\ANT_HOME\apache-ant-1.7.1\bin)

So now all the required components has been successfully installed.

Step 2 : Getting and Building the sources

Get source code
After environment setup you need to get Apache Savan source code.
You can get the source code by checking out it from here.

Build source Code
By using the windows command prompt go to folder where you checked out the Savan source code.
execute the following commant to build the sources. (mvn clean install)
This command will read the sources and will download the needed libraries.
It will take some time to successfullty download all the required libraries.
When all the components are built successfully you can start running a simple Savan enabled application.

Step 3 : Running sample application

Build sample application
By using the windows command prompt go to folder where you checked out the Savan source code.
Then navigate to the modules\samples\eventing directory.
Execute the following command to build the sample application. (ant deploy)
This will create all the files needed to run the sample.

Run sample application
Go to the folder where you choosed as AXIS2_HOME.
Go to the \repository\modules folder and copy the "savan-SNAPSHOT.mar" file in to relavant directory of the tomcat server. (e.g. C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\axis2\WEB-INF\modules)
Go to the \lib folder and copy the "savan-core-SNAPSHOT.jar" file in to relavant directory of the tomcat server. (e.g. C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\axis2\WEB-INF\lib)
Go to the \repository\services folder and copy "ListenerService1.aar", "ListenerService2.aar","PublisherService.aar" files in to relavant directory of the tomcat server. (e.g. C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\axis2\WEB-INF\services)
Restart the tomcat server.
You will see the new sample application we build is deployed in the Axis2 server.

Step 4 : Advanced configurations

You can specify more advanced features of by login in to the Axis2 admin panel.
Go to http://localhost:8080/axis2/axis2-admin/ for it.
The default username - Admin
The default password - axis2

Thursday, July 2, 2009

Commencing Savan Broker


Welcome to the Savan Broker community!

This is to announce the commencement of the project Savan Broker where we plan to implement an efficient and scalable brokering system for the Savan module of Apache Axis2. Four of us got together to carry out this as our final year project at the Department of Computer Science and Engineering of University of Moratuwa, Sri Lanka. Our mentors are Mrs.Vishaka Nanayakkara and Dr.Srinath Perera.
Savan is the WS-Eventing implementation for Apache Axis2( Apache Axis2 is an open source framework for providing and consuming web services-a SOAP processing framework.). WS-Eventing is about using the Web services framework for implementing a Publisher-Subscriber model. Web Service Eventing is a protocol that facilitates the implementation of publish/subscribe model by allowing web services to subscribe to or accept subscriptions for event notification messages.
Publish/subscribe communication paradigm has recently received increasing attention due to its loosely coupled nature of distributed interaction in large-scale applications. With systems based on the publish/subscribe interaction scheme, subscribers register their interest in an event, or a pattern of events, and are subsequently asynchronously notified of events generated by publishers.
The goal of our project is to extend the Savan module to implement a scalable and efficient brokering system. The approach we plan to take is to develop the brokering unit in a step by step manner, starting from one broker with a topic list and improving it to two broker system and then to a multiple broker system with other add-ons such as implementing different topologies for the broker hierarchy, more QoS (Quality of Service) support, multiple matching engines, Topic Discovery Nodes and so on. In selecting suitable topologies for the broker hierarchy, we plan to carry out a scalability analysis of different topologies currently being used in the brokering systems.

All the project updates, source code, documentation and discussions will be hosted at https://sourceforge.net/projects/savanbroker/