Tuesday, September 20, 2011

New Angle to look at SOA...

--- essence from Ganesh Prasad's Practical SOA 

Among numerous trends that has struck the IT industry, SOA holds an important place. Service Oriented Architecture has been a buzz word, for a certain period of time. Most of the enterprises and businesses proudly announce that they "MOVE to SOA"; or their "Business is SOA compliant". But when we take a look at their implementation, still it resides in the complex, spaghetti kind of set up. This complexity and non SOA existence can majorly cause
  • performance drawbacks
  • single point of failure
 If a proper SOA implementation has been executed, it ideally should have
  • loosely coupled components
  • good governance
  • re-usability of components
In a proper SOA architecture, there are 3 main lego blocks namely
  • Service Container
  • Message Broker
  • Process Coordinator 

Service container - Holds the service logic (eg: WSO2 AS)
Process Coordinator - Run time / dynamic process evaluations based on state is handled here. (eg: WSO2 BPS)
Broker - Acts as an adapter, mediator and transformer. Sits in between two applications perform the tasks. (eg: WSO2 ESB)

In any kind of complex deployment environment, first it should be clearly identified what is needed where, out of the above 3 main components.
When the coarse grain analysis is over, in the fine grain analysis, supporting SOA elements such as Rule components, Data services components, Presentation components, Governance components, Registry/repository components etc. can be identified and then deploy the relevant systems appropriately. 

SOA is NOT EASY. But SIMPLE. So plan well & handle with care.

Monday, September 5, 2011

WSO2Con 2011 - Hub of Expertise, Experience and Knowledge

All are keen; lots of enthusiasm; late night hours; ideas coming from every nook and corner; constant follow ups - sync ups; from the topmost head of the office to all the colleagues and subordinates and even the machinery are busy; focused on one main thing. WSO2Con 2011, the BIGGEST IT Conference in Sri Lanka is being held for the second consecutive time with splendor and glamour.

As almost all the WSO2ers too, I am so excited to be a part of this Gala event, rather to be an active participant this time. Because by the time that the last year's WSO2Con 2010 was happening, I was just a mere spectator/ audience there because I was a 'just joined' to WSO2 and had no clue at all what were there around. 

Things started with I getting involved with Undergraduate Registration for the Con. Having a round of lengthy calls with all the Heads of the local and foreign Universities to pass the SPECIAL STUDENT OFFER message, mailing e-flyers around and visiting all the universities to distribute promotional printed material was an enjoyable experience indeed. 
And now looking forward to execute the selection process on the 120+ undergrad registrants and select the TOP 50 who will be lucky participants to witness and be a part of this event. 

Indeed one should be lucky to witness this event because this will have an eminent set of key note speakers from enterprise giants such as Dr C. Mohan from IBM  (Former IBM India Chief Scientist)Sastry Malladi form eBay (distinguished Architect), Gregor Hohpe from Google (Engineer). Also another 20+ speakers who deal with immense industry know how will share their thoughts about the industry trends, customer experiences with WSO2 and expertise with the audience. 

The event which comprise of 3 conference days and 2 tutorial days will be a spring of knowledge to the participants. The registrants have the choice of selecting the speech and tutorial sessions according to their interest out of the multiple available tracks. Have a look at the program line up

This time the Conference will be from September 12th - 16th at Waters Edge, Sri Lanka, one of the picturesque locations which is enriched with natural beauty of Sri Lanka

Log in to WSO2Con 2011 page and registerStill you are not late to get hit from the IT storm of Sri Lanka. 
See you there!!!

Sunday, September 4, 2011

Dynamic WS-Discovery of WSO2 ESB

Web Services Discovery (WS-Discovery) is a protocol that locates web services in a network. As the name implies, the actual communication between nodes is done using web services standards (WS standards) especially in SOAP-over-UDP.
In WS-Discovery, services that are hosted in an Application server or any other service hosting environment can be exposed via a Discovery Proxy (which is default available in products like WSO2 Governance Registry), to another external Discovery client.

Example Use Case
Actual services are hosted in WSO2 Application Server (AS).
WSO2 Governance Registry (G-Reg) acts as the central repository with Discovery proxy, where all the discovered service related metadata are stored.
Discovery client would be WSO2 Enterprise Service Bus (ESB) where it consumes the discovered services and create endpoints and proxy services using them.

Two ways exist that WS-Discovery can be configured in WSO2 Carbon products.

  • Static Discovery
  • Dynamic Discovery
Static Discovery
In this aspect of WS-Discovery, the services are located and referenced via the service's actual URI. More details on Static Discovery can be read from here
Dynamic Discovery
In service discovery, each service is obtained a unique ID (a.k.a UUID) Dynamic Service Discovery uses the uuid to refer the actual services instead of the actual URI of the hosted service. 

Following the steps below will take you to a successful dynamic WS-Discovery environment set up.

Step 1 - Set up environment
Download WSO2 AS, WSO2 G-Reg and WSO2 ESB
Change the offset parameter which resides in each of the above products' $CARBON_HOME/repository/conf/carbon.xml, so that, ESB runs in port 9763, AS in 9764 and G-Reg in 9765.
    eg. Open $AS_HOME/repository/conf/carbon.xml and change the offset parameter to 1. 

Step 2 - Start up Discovery Proxy
Start up the G-Reg. If you access through this http://<ip_address_greg>:9765/services/DiscoveryProxy?wsdl, URL, you will observe that the Discovery proxy service is started up and running, and the service is accessible via the endpoint, http://<ip_address_greg>:9765/services/DiscoveryProxy (make a note of this endpoint URL, for the ease of usage in further steps. )
    eg. http://localhost:9765/services/DiscoveryProxy

Step 3 - Configure service hosting environment
Go to $AS_HOME/repository/conf/axis2.xml and add the following parameter.
<parameter name="DiscoveryProxy">http://localhost:9765/services/DiscoveryProxy</parameter>
When we add this discovery proxy endpoint to AS, for all the existing services and new services that are getting deployed in AS, it sends a unicast hello message to the network. 
Restart AS with this addition. 
Go to G-Reg management console and go to Metadata --> List --> Services page. It will show up all the services that are available in AS as discovered services. If you deploy a new service in AS, that will also get reflected in the Metadata service list in G-Reg since all these services send a unicast hello messages to discovery proxy and register them selves in G-Reg. 
You will notice that each and every service is assigned with a unique service name as well. 

Figure 1: G-Reg Service List displays the Discovered Services

Step 4 - Configure Discovery client for 'Dynamic' mode
As mentioned above, WSO2 ESB will act as the discovery client where it can invoke the discovered services via the Endpoints and Proxy services created utilizing the Discovered services itself. 
  4 (a).  Install the WS-Discovery Mediation Extensions feature

Start up the ESB and go to Configure --> Features. In 'Feature Management' wizard, click on 'Add Repository'. Give a name to the repo, and as the URL specify the below and click Add
    eg: http://dist.wso2.org/p2/carbon/releases/3.2.0
From the populated feature list, select the following feature
    WSO2 Carbon - WS-Discovery Mediation Extensions
Install it and Restart the ESB server. 

   4 (b). Configure the synapse registry to pick the new features
Log into ESB. Go to Manage --> Service Bus --> Source View. To the configuration, add the following two parameters. 

<parameter name="discoveryProxy">http://localhost:9765/services/DiscoveryProxy</parameter>
<parameter name="extensions">org.wso2.carbon.discovery.mediation.ext.WSDiscoveryRegistryExtension</parameter>
And save the configuration. (No need to restart)
The same thing can be done from the file system as well. 
Go to $ESB_HOME/repository/conf/synapse-config/registry.xml. Add the above two parameters to the file, save and restart ESB. 
   4 (c). Enable WS - Discovery
Log into ESB Management Console and go to Configure --> WS-Discovery. Click on "Add Discovery Proxy" link to add a new proxy. You will be directed to discovery proxy settings screen in which you can give a name for the proxy and the remote DiscoveryProxy URL (In our case http://localhost:9765/services/DiscoveryProxy). 
Figure 2: Discovery Proxy Configure page in ESB

You will be redirected to the home page of WS-Discovey Control Panel once the proxy is created. The created proxy will be listed in the control panel home page. Click on "View" to find the target services and endpoints discovered by the proxy. You will be directed to a page as shown below. 
Figure 3: ESB displays Dynamically discovered services

Step 5 - Create ESB Proxy etc using the Discovered Services
In the same WS-Discovery service stat page, click on a preferred service ID. It will redirected to a Service Summary page, where all the statistics regarding the particular service is listed. Also it will facilitate you to create ESB Proxy Services and ESB Endpoints using the particular service, which is very convenient in user point of view.  

Figure 4: Create EPs, Proxies using Discovered Services