WSO2 Stratos – A true cloud story

Stratos Services

Yesterday (1st of June), A little over a 12 developer team at WSO2, took a great middle-ware platform in to the cloud. It’s not just putting all our server products on an EC2 instance, but embedding all cloud-native features into them. The PaaS (Platform as a Service) is named as WSO2 Stratos, which is based on award winning WSO2 Carbon middle-ware platform. As the Alpha-1 release, Stratos offers number of WSO2 products integrated, namely Governance Registry (GREG), Identity Server (IS), Business Activity Monitor (BAM), Mashup Server (MS) and WSO2 Gadget Server (GS).

Stratos is also offered as a downloadable version for the private cloud within your enterprise. If you are quite serious about using SOA for your enterprise and do not need to worry about deployment, scalability and server maintenance, Stratos would be the ideal solution for you.

Advertisements

Linux for human beings

This is a post that should have been written few days back, On April 29th Ubuntu 10.04 – (Lucid Lynx) was released, and I was counting days till it did but couldn’t try it out because of the release work I was doing in my machine. Last weekend (even the work wasn’t quite over) my anxiousness couldn’t rest. I installed the new beast keeping my /home safe. To tell you the truth, the installation process was hardly “linux like”. There were no screens showing any commands executing, nor view of the terminal. What you see is a breath taking slide show (very much windows like, but much sweeter) trying to show off the beauty 😉 and market itself.

Ubuntu - 10.04 (Lucid Lynx)

Well I know many of you already have tried Lucid, and there is nothing new for me to mention, hence I thought of writing few words about Ubuntu’s slogan “Linux For Human Beings”. My history as a Linux user is not that ancient, even though I have used it side by side with a  Windows OS, I’ve never gone total Linux, There were reasons behind. {1} I was afraid it will all break down in the middle of something. {2} It looked like a dark cave with alot of never ending tunnels {3} It was hard for me to troubleshoot on my own (I was a novice). But thanks to Sandaruwan and the never ending virus problems, performance degradation with time in windows, I jumped in to the deep-end. Ever since am a happy man 😉

Before Ubuntu, I have tried Debian and Suse, but with Ubuntu I felt quite safe. There were number of reasons, among them, Canonical released frequent updates and bug fixes (mainly fixes related to hardware drivers). Ubuntu’s is doing major release twice a year with a considerable amount of improvements, and nevertheless its Virus free, ultra fast and very stable for a software development environment.

Being those my reasons, I believe Linux is the answer for many 3rd world countries, to obtain a high IT literacy rate. When Microsoft and other proprietary software vendors are investing in millions and billions to put a full-stop to software piracy (Which as a software engineer I encourage), and when personal computers are sold with these proprietary software pre installed (Ofcause not for free) with prices automatically goes sky high, resulting a normal user to look at a computer as if it is a Jet plane ;).

But for some (many) reason free and open source software is hidden to the normal user world. Of-cause there are few myths associated, One popular myth is that Open source and free software doesn’t come up to the standard of proprietary software, If we forget for an instance that I work for a 100% open source company 😉 , and look at Apache software foundation, where there are plenty of great products (Apache HTTP server, Tomcat, Maven, Synapse et al.), but normally the argument is “A normal user doesn’t care about the server space. What does free software offer for them ?, to listen to music, edit some photos, check email and browse internet” ? And as far as I see this is where Ubuntu places itself. I believe this is why it displays a pretty screen while its being installed and I think so far Ubuntu had done a great Job, and it is ready with a strong and shiny armour, to battle with any proprietary operating system and make it’s mark.

So if you are a normal user reading this article, try new Ubuntu, and when you are buying your next personal computer, ask you computer supplier to give the machine with Ubuntu. I promises you, you will save a hell a lot of money, and it will set you free. 🙂

WSO2 Gadget Server 1.1.0, What to expect

WSO2 Carbon 3.0.0 – code name “Iridium” is just about to release in few more days. as of WSO2’s release strategy, all the products will graduate with their next version on top of carbon based platform. As for the newly released Gadget Server it would be version 1.1.0

Features were frozen for version 1.1.0 and that was in the end of February as I recall. We (the GS team) managed to squeeze in few new very important features to this release.

  • Upgraded shindig to the latest version

This was a bummer, since WSO2 Carbon platform is running on OSGi, if you had to use a non native OSGi project (i.e. Shindig) you will have to create an OSGi aware carbon orbit bundle and make use of it at run time. This was done some time back where shindig was on r734876 revision. In-order to leverage new functionalities such as OAuth, Pub-Sub etc. and to patch the bug fixes we thought of updating the shindig carbon orbit bundle. So now shindig is on r910768 and is quite up to date.

  • i18n internationalization support for gadgets

i18n is not a big deal for Google gadgets since the gadget API itself supports it, What we had to do is enable i18n support in shindig. (Which was already implemented by the shindig community)

  • Inter Gadget communication

Inter gadget communication, seemed to be the hot topic in our forums and webinars, all most in all tech talks we did about the Gadget Server, some person in the audience raised the question about gadget-to-gadget communication. Our answer was “it can be done at shindig level, and we are yet to support it”. So without a long await, with GS v1.1.0 we enabled this feature. The architecture is quite fascinating where there will be zero backend calls and all the communication is done simply on the front-end. Basically each publisher will have a publishing channel and the subscribers can subscribe to this channel. After that its simple pub-sub.

  • The portal will completely run on HTTP transport

This was a limitation we had in our fist release. The portal was running only on HTTPS, and the reason behind was that all WSO2 products are running on secure transport and the Gadget Server is also a combination of some specific components which ran on the same platform. For this release we went the extra mile and enabled HTTP for the portal. So once you go to the login page it will switch to the secure transport (HTTPS) and after successful login you will redirect back to the HTTP non-secure mode. (Of cause you can disable HTTP any time and run the portal purely on HTTPS, it all depends on the requirement.)

One disappointment I have is that we couldn’t integrate OAuth on time. even though it is supported at shindig level we have to do a considerable amount of work from the Gadget Server side to fully support it, hence it is postponed to our next release. You can try the sample OAuth GData Gadget, simply adding it by the URL, and that will work like a charm. (nothing useful but just to let you know that we are only few steps behind on it)

Okey so enough sneak peak 😉 download the Gadget Server pre-beta, play with it, and help us to improve (even in the last minute) by reporting any issues.

Cheers !!

Authoring, deploying and using XML Gadgets in WSO2 Gadget Server

We are about to release The long awaited WSO2 Gadget Server within few days of time. These few days I was doing some documentation and content writing about the Gadget Server, Apache Shindig and Google gadgets specification. My 1st article about authoring gadgets is now published on WSO2 Oxygen Tank as a help/Tutorial for Gadget server users. You can also download the Gadget Server release candidate 2 and play with it. Also Paul had written an interesting article about portals and Gadgets Server’s role.

That and This

Nothing much new to write, was busy with work, WSO2 Gadget Server is about to release in the coming weeks, (I’ll be writing a whole story about it in a coming post). Apart from all those, my first article was published today in the diGIT magazine, which is a free online IT magazine run by a bunch of Sri Lankans. For some time I wanted to write about SOA and my findings in my final academic year, I thought I will blog about it. But never got a chance or rather, who will read about SOA in my blog :D. For many of such reasons I thought of contributing to diGIT mainly about SOA. With its December issue, my first article about SOA got published. you can check it out at http://digit.lk/09_dec_soa2 and leave a comment here 🙂

Other than that, The Apache Asia Roadshow 2009 is happening in town Dec. 3rd, 4th and 5th. On 4th morning I will be talking about Apache Shindig and our experience in WSO2 Gadget Server along with Tyrell. So pay a visit on the event am sure it’ll be awesome.

Lesson learnt the hard way

Terminator was running in four segments, top left was a maven build, top right was a svn update, in one of other two an apt-get was running and I was playing on the smaller one left in bottom right. My notebook was running on battery power and I forgot to plug it in to AC, before the box got hibernate. Once I reboot it with AC power my X-Server was gone !! I couldn’t see the log-in screen and it just left me with the console in full screen.

I am not a linux guru, but i tried few commands, “startx / dkpg -reconfigure / nvidia-config / etc”. I had to run to our sys admin since he is considered the guru :D. with few commands at flash speed he got the x-server running again. but it was all broken here and there. couldn’t hear sound, installed apps were not working and above all when I reboot, I had to type “startx” each time to see the display (Which was a pain and made me itchy :P). Chamith’s idea was even if he could get the x-server running in normal mode, some errors that am getting wont be able to fix. so the best option to make all smooth is to re install the OS and he said “No probs ne machan (sinhala way of saying dude / bro 😉 ), ur home is in a different partition right ? so its a matter of ten minutes to restore the root in the other partition.” – OH CRAP NOOO my /home was also in the same partition and I only had one single big partition. 😦

SO yeah I had no other option left, I had to back up 20GB of my /home dir and re-install ubuntu 9.04. (Coping 20GB from here and there is a crappy and a messy job) I was struggling with the fix till today morning and finally got everything smooth again.

SO the lesson from all of this is. keep your /home mounted in a different partition. I learnt the lesson, the hard way.

Writing custom queries to retrieve data from WSO2 Governance Registry

WSO2 Governance Registry is a big part of wso2 governance product stack. Even though it is primarily aimed at managing, versioning, rating, and commenting on SOA artifacts it can also be used as a simple data store. with the 3.0 version the G-Reg gave support to custom query execution from the client side. This feature helps immensely when you use the registry for non-standard tasks. For me I had to do some pagination work for the comments that belongs to a particular resource, hence my approach was to write few custom quires to get the job done. The code is as follows.

	/**
	 * Returns a chunk of comments
	 * 
	 * @param resPath	Path to the comment
	 * @param start		The beginning index
	 * @param size		Size of the chunk
	 * @return			an array of comments
	 */
 public Comment[] getCommentSet(String resPath, int start, int size) {
		Registry registry = null;
		try {
			registry = ; // get an instance of the registry 

			Resource comQuery = registry.newResource();

                        // The Sql Statement
			String sql = "SELECT REG_COMMENT_ID FROM REG_RESOURCE_COMMENT RC, REG_RESOURCE R, REG_PATH P WHERE "
					+ "RC.REG_VERSION=R.REG_VERSION AND "
					+ "R.REG_NAME=? AND "
					+ "P.REG_PATH_VALUE=? AND "
					+ "P.REG_PATH_ID=R.REG_PATH_ID LIMIT ?, ?";

			// Set SQL statement as the resource content
                        comQuery.setContent(sql);

                       // Setting the media type and properties
			comQuery.setMediaType(RegistryConstants.SQL_QUERY_MEDIA_TYPE);
			comQuery.addProperty(RegistryConstants.RESULT_TYPE_PROPERTY_NAME, RegistryConstants.COMMENTS_RESULT_TYPE);

			registry.put("system/myQueries/query", comQuery);
                 String resourceName = "testResource";
                 String pathToResource = "/system/myResources"

			Map params = new HashMap();

                        //Setting the parameters
			params.put("1", resourceName);
			params.put("2", pathToResource);
			params.put("3", start);
			params.put("4", size);

                       // Executing the SQL statement
			Collection qResults = registry.executeQuery("system/myQueries/query", params);

			String[] qPaths = (String[]) qResults.getContent();

			Comment[] comments = new Comment[qPaths.length];
                        // Loading the comment data to comment object array 
			for (int i = 0; i < qPaths.length; i++) {
				if (registry.resourceExists(qPaths[i])) {
					comments[i] = (Comment) registry.get(qPaths[i]);
				}
			}

			return comments;

		} catch (Exception e) {
			String errorMsg = "Backend server error - could not get comment set";
			log.error(new MyTestException(errorMsg, e));
			return null;
		}

	}

Yeah simple as that you get your resources set without much effort. A big thank goes to Dimuthu