Friday, October 3, 2008

Local Proxy & Federated Portals

I remember those days when Enterprise Java Bean (EJB) was a big buzz and every project want to use them. They used so much that the projects and applications that didn't demand an use for enterprise level services started implementing them. I felt like that was another 'Gold Rush' people didn't want to miss. After a while everyone started realizing that EJBs are not for everyone. Also EJBs could only be accessed remotely when they originally released in EJB 1.0. But application server vendors provided their value addition by optimizing the local access to an EJB by by-passing RMI. This gave a hint to the standards committee and they included this as a feature - Local Interfaces in the later EJB Specification 2.0. So in short Best Practices started to emerge and now you can say the usage of EJBs in IT projects got streamlined.

You could be wondering why am I taking about EJBs when the title of this blog reads 'Local Proxy & Federated Portals'. Now coming to the portal paradigm, Web Services Remote Portlet is a specification from OASIS Technical Committees which defines a web service interface for interacting with presentation oriented web services. The portal application that provides their presentation oriented services for consumption by other portal servers is called as a Producer and the later is called as a Consumer. Typically, a consumer application does not include the business logic, data, or user interface parts of the portlet: instead it simply collects the user interface markup delivered from producers and presents that user interface to users. One can use interceptors to programmaticaly customize the data on the receiver end as well.

As WSRP is a web services protocol, communication between the producer and consumer happens over SOAP. This communication involves serialization and deserialization and also intermediate buffers. This is the case even when the producer and consumer are located on the same server (runtime). Oracle WebLogic Portal 10 includes a new feature Local Proxy Mode. You can enable local proxy support by setting to true in WEB-INF/wsrp-producer-registry.xml in the consumer web application which will optimize the communication by avoiding network I/O. If the consumer finds the producer deployed on the same server then it will avoid the SOAP over HTTP and will use the local proxy. This saves the overhead from serialization and deserialization of SOAP. Internally WebLogic Portal will use the same execute thread to invoke the producer using servlet API. When local proxy mode is enabled the remote proxy can also be used by remote consumers. Java portlets or third-party portlets deployed on the same server can be integrated without requiring any modifications. This reminded me of the local interface with EJBs which evolved when people started realizing that they are consuming EJBs more locally than remotely.

You can find more information on WSRP here - http://e-docs.bea.com/wlp/docs100/federation/Chap-Details.html#wp1021292.
For information on local proxy mode see here - http://e-docs.bea.com/wlp/docs100/federation/Chap-Best_Practices.html#wp1010714.

No comments: