Real world scenarios with the WSO2 ESB
Three real world scenarios in some detail 1. XML transformation and message augmentation 2. Financial services case – reading legacy files and integrating with JMS 3. The PushMePullYou – using polling to integrate two services
XML Transformation of messages with Database augmentation This example illustrates how a database table lookup can be used to augment and transform the message payload, using XSLT transformations Objective
Configure the external database access Specify SQL and map parameters, and results Transform using XSLT
Scenario – Financial Security blocking Database legacy flat file NEW YORK Existing System WSO2 ESB Poll Record->XML XML->XML Send LONDON WSO2 ESB Split/Iterate DBLookup/Filter Transform to MQ Send Existing System XML/JMS
Overall ESB flow FileSystemListener NY Sequence Log Out-Only Flatpack E4X Send to London LondonEndpoint LondonSequence Iterate DBReport – log whole msg Filter/Drop NOAC Send
Proxies
New York – File System Listener
New York Sequence
Flatpack Mediator
Transforming using E4X
Scripting XML with E4X <![CDATA[ var rowset = mc.getPayloadXML() /* use the default namespace from the Flatpack mediator */ var ns = new Namespace(" /* find all the D6 rows */ var d6 = /* create a holder element for the elements */ var output = for (var i=0; i<d6.length(); i++) { var row = d6[i]; /* lookup the important data */ var ActionKey = var AccNum = var ActType = var SecID = var SecIDType = var ONVF = var UnitsEl = var RegCode =
Scripting XML continued var feed = {ActionKey} {AccNum} {AccType} {SecID} {SecIDType} {ONVF} {UnitsEl} {RegCode} ; output.appendChild(feed); } mc.setPayloadXML(output); ]]>
London - Iterate
Log the whole message
Final steps
PushMePullYou
Pull n Push scenario
Task Configuration specify the task implementation task properties task scheduler configuration
Calling the data service external data service endpoint configuration
Calling Clearance Service split the message into number of messages transform the individual messages clearance service endpoint
Clearance Response transform the responses from the clearance service aggregate the responses from the clearance into one response
Summary Covered a set of useful cases Changing the flow of control Iteration and Aggregation Two ways of transforming XML Reading record formats Integrating with File-based systems DBReport and DBLookup
Questions
Resources WSO2 Webinars WSO2 ESB documentation /docs_index.html /docs_index.html User List Recent performance testing