Saturday, February 22, 2014

WSO2 ESB Performance Round 7.5

Sometime ago, there was performance blog saying that some of the performance stats published on WSO2 ESB are incorrect and flawed. So, WSO2 ESB team has carried out some investigations on these and published the latest performance test results based on their latest release WSO2 ESB 4.8.1.

The latest round of performance testing results published by WSO2: WSO2 ESB Performance Round 7.5

The following table and graph show the summary results of the performance test. This graph takes the average across all message sizes.

The tests has been conducted against number of leading open source ESB's and it is proven that WSO2 ESB ahead in almost all the scenarios.

You can download the latest WSO2 ESB 4.8.1 at WSO2 Enterprise Service Bus

The user guide and the documentation can be found at WSO2ESB Documentation

Saturday, February 8, 2014

Securing your Web Service with OAuth2 using WSO2 IS


Web applications sometimes need access to certain user information in another web service. In such a case how do you get your app authorized, on behalf of user, against that web service? Years ago this problem was solved by user giving their credentials to web application and then the web application uses them to authenticate itself against the web service. But, in user’s perspective, giving away their credentials to another web application to log in as himself, is not a good story, because with user credentials, web application gets the full control of user account until user changes their password. People needed a solution for this, and they came up with a variety of solutions such as Google AuthSub, AOL OpenAuth, Yahoo BBAuth, Upcoming api, Flickr api, Amazon Web Services api [1] etc. But there were a lot of differences between each of them, and so people needed a standard for this. This is where OAuth came into play.

What is OAuth?

OAuth is an open protocol which enables an application to access certain user information or resource from another web service, without giving user credential for the web service to the web application. For example, a user needs to allow a third party application to change his twitter profile picture. When OAuth is used for authorization, it allows 3rd party application to change user’s profile picture after user authorize it to do so without giving credentials directly to the web application.

Tuesday, January 21, 2014

How to Debug WSO2 Carbon Products using OSGi Console

This post is basically for myself :) , and will be useful for you as well. Intent of this post is to list down frequently used and most useful OSGi commands with examples. For the sake of completeness I will give a small description before stepping into OSGi commands.

Here I will show how to debug WSO2 Carbon products via OSGi console. First you have to start Carbon server with -DosgiConsole property.

./ -DosgiConsole

Once the server is started properly, you can start trying commands in OSGi console. Here are some mostly used OSGi commands.

1) ss

Lists down the bundles with the life-cycle state of them.

ss <bundle_name>

Searches for given bundle name and lists matching bundles.

eg. osgi> ss data

osgi> ss data
"Framework is launched."

id State       Bundle
36 ACTIVE      gdata-core_1.47.0.wso2v1
37 ACTIVE      gdata-spreadsheet_3.0.0.wso2v1
40 ACTIVE      h2-database-engine_1.2.140.wso2v3
110 ACTIVE      org.eclipse.equinox.p2.metadata_2.1.0.v20110510
      ... ... ... ... ...

2) b <bundle_Id>

Shows the details for the specified bundle. Here bundle_id  can be figured out using above ss command.

Monday, January 20, 2014

Load Balancing and Failover in JDBC Drivers

When you have to connect your java application to a database in a database cluster, using a JDBC driver, you can simply connect to one of the nodes of the cluster. (For example, if it's a MySQL cluster you can connect to one of its SQL nodes.) But what happens if that node goes down? You lose the connectivity to the cluster and high availability aspect too which is one of main intents of having a cluster. Connecting to a single node makes a single point of failure. How do we avoid this?

If we can achieve failover aspect, we can avoid above situation. And fortunately most of the JDBC drivers support failover (and load balancing too). Intent of this post is to list load balancing/failover supported JDBC URLs of some popular JDBC drivers.



Here, it is load balanced among given hosts. If a node is down while you're trying to connect, JDBC driver retries to connect for the given time period  (loadBalanceBlacklistTimeout). If the node is still down it tries to connect to another node. That's how failover is achieved by this.

SQL SERVER (Microsoft JDBC driver)


Here it supports only failover. If the active node is down, it connects to the failover (passive) node.



Please comment if you know URLs of any other JDBC Driver.

Sunday, January 19, 2014

How to Solve "Auto Backup Stalled" Error in Your Phone

"Auto Backup Stalled. 3 Days Since Last Backup"

Since a few days ago, I've been getting this error message on my phone. That was very annoying. So I Googled a little, and found the cause and a solution.

This is caused by the photo backup feature in Google+ app in my phone. This occurs if you enable Auto-Backup and disable Auto-Sync.

So the simple solution is to either enable or disable the both of them. You can do that at 
Menu > Settings > Auto Backup
Hope this will be helpful to someone.