Thursday, March 28, 2013

[WSO2 ESB] XSLT Mediator Properties


In this post I am discussing how we can use "Properties of the XSLT mediator" in XSLT transformations.

We can inject Properties which we set in the mediation flow to the XSLT script as a XSLT parameter.

Following is a sample configuration of a XSLT mediator having a property.



     



Here PARAM_NAME is the name of the Property and the value is calculated using a xpath expression. Here we assign the value of the "ORDER_ID" property which is in the default scope.

Following is a sample XSLT script.


      
      
         
            
               
            
         
      


First we have to define the parameter as follows. Name should be identical to the name of the property.


Then we can access the value of the parameter as follows.


Sunday, February 10, 2013

My Experience with World's Fastest ESB



The world's fastest ESB, 4.6.0 version of WSO2 ESB got released few days ago.
Comparing to earlier versions of WSO2 ESB, this version has improved significantly in mediation performance.

In this version, Pass-through HTTP transport is used as the default http transport.
Pass-through transport is there since ESB 4.0.0 but the major disadvantage in previous versions is, Pass-through transport was supported only for pass through mediation scenario (pass through proxy) and for the transport header based routing. Content aware mediation scenarios like CBR (content based routing) was not supported by Pass-through transport. That prevented making the Pass-through the default transport for HTTP even though it performs well over NHTTP transport. 


In 4.6.0, Pass-through transport supports both content aware and content unaware mediation scenarios, so now there is nothing preventing from making it the default transport for http. Hiranya has written a very nice detailed post on “How the World's Fastest ESB was Made” explaining the history and the technology behind the Pass-through transport.

Recent performance evaluation, ESB Performance Round 6.5 shows how well the WSO2 ESB 4.6.0 outperforms the others. Following is a graph extracted from the results published in ESB Performance Round 6.5.

 





Following graph illustrate the memory usage throughout 40 hours of long running performance test. 
It indicates how stable ESB 4.6.0 under high load for a long period of time.  





Last week I got a chance to work on implementing an integration scenario for a tutorial session of WSO2Con 2013 together with Kasun and Ishan.
The scenario is an extended version of well known “How to GET a Cup of Coffee the WSO2 Way” integration scenario.
Following are some of the key parts of that scenario.

  • Exposing a REST API for a SOAP service through ESB
  • JSON Handling
  • XSLT transformations
  • User authentication through Oauth
  • JMS Message Stores and Message Processors
  • Content based routing
  • Protocol switching
  • Many other EIP patterns like Message cloning/Iteration/aggregation
  • Integration with Data services
  • Integration with Message brokers
  • Sending Email notifications
  • Sending Tweets

We managed to implement all above scenarios using ESB 4.6.0.
That indicates how well the default Pass-through Http transport behaves for both content aware and content unaware scenarios.

Some of the minor but very useful improvements done in 4.6.0 is yet hidden under the shadow of this huge performance improvement.

Callout mediator has improved significantly. Now Callout mediator supports following features.

  • Can specify a security policy to invoke secured services
  • Has an option to specify different security policies for inbound and outbound paths
  • Can specify an Address Endpoint instead of the service url
  • Support sending soap headers
  • Support sending transport headers
Deploying API configurations from CAR files is now supported in this release.

These facts clearly indicates that WSO2 ESB 4.6.0 release is not just about performance.

WSO2’s Swiss Army Knife Of SOA is in business for all aspects of Enterprise Integration..!

Monday, January 28, 2013

[WSO2 ESB] Enable XPath 2.0

XPath 2.0 support is available in WSO2 ESB 4.5.0 and later versions.

To enable XPath 2.0 functions, we have to uncomment following entry in the synapse.properties file.
synapse.xpath.dom.failover.enabled=true

synapse.properties file is located at $ESB_HOME/repository/conf directory.
After enabling xpath 2.0, you will able to use xpath functions like "codepoint-equal()" in your synapse configuration.

If you are using synapse specific xpath functions like "get-property()" within a xpath 2.0 function you have to use them with the prefix "syn".

Follwoing is an example for a such usage.




Above function uses "codepoint-equal()" xpath 2.0 function to compare two properties.