Wso2 Scenarios Esb Webinar July 1st


Published on

Paul Fremantle (CTO),
Asankha Perera (ESB Architect), Ruwan Linton (Senior Software Engineer)

Published in: Technology, Business
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Wso2 Scenarios Esb Webinar July 1st

  1. 1. Real world scenarios with the WSO2 ESB Paul Fremantle, CTO Asankha Perera, ESB Architect Ruwan Linton, Senior Software Engineer 1 st July 2008
  2. 2. ESB 1.7 Webinar Series <ul><li>June 17 th – Introducing WSO2 ESB 1.7 </li></ul><ul><li>July 1 st – Example Integration Scenarios </li></ul><ul><li>July 3 rd – Introducing WSO2 ESB 1.7 (repeat) </li></ul><ul><li>July 15 th – Using WSO2 ESB with FIX </li></ul><ul><li>July 29 th – Complex Event Processing </li></ul>
  3. 3. Three real world scenarios in some detail <ul><li>1. XML transformation and message augmentation </li></ul><ul><ul><li>Asankha Perera – Lead Architect, WSO2 ESB </li></ul></ul><ul><li>2. Financial services case – reading legacy files and integrating with JMS </li></ul><ul><ul><li>Paul Fremantle, CTO </li></ul></ul><ul><li>3. The PushMePullYou – using polling to integrate two services </li></ul><ul><ul><li>Ruwan Linton, Senior Software Engineer </li></ul></ul>
  4. 4. 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
  5. 6. Configure the external database access Specify SQL and map parameters, and results Transform using XSLT
  6. 10. 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
  7. 11. 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
  8. 12. Proxies
  9. 13. New York – File System Listener
  10. 14. New York Sequence
  11. 15. Flatpack Mediator <class name=&quot;org.apache.synapse.mediators.contrib.FlatPackMediator&quot;> <property name=&quot;ParserType&quot; value=&quot;records_config&quot;/> <property name=&quot;config&quot;><PZMAP xmlns=&quot;&quot;> <COLUMN name=&quot;INDICATOR&quot; length=&quot;2&quot;/> <RECORD id=&quot;D6&quot; startPosition=&quot;1&quot; endPosition=&quot;2&quot; indicator=&quot;D6&quot;> <COLUMN name=&quot;INDICATOR&quot; length=&quot;2&quot; /> <COLUMN name=&quot;ACTIONKEY&quot; length=&quot;16&quot; /> <COLUMN name=&quot;NA1&quot; length=&quot;5&quot; /> <COLUMN name=&quot;ACCNUM&quot; length=&quot;15&quot; /> <COLUMN name=&quot;ACTTYPE&quot; length=&quot;6&quot; /> <COLUMN name=&quot;SECID&quot; length=&quot;12&quot; /> <COLUMN name=&quot;SECIDTYPE&quot; length=&quot;3&quot; /> <COLUMN name=&quot;REGCODE&quot; length=&quot;5&quot; /> <COLUMN name=&quot;NA2&quot; length=&quot;56&quot; /> <COLUMN name=&quot;ONVF&quot; length=&quot;3&quot; /> <COLUMN name=&quot;NA3&quot; length=&quot;244&quot; /> <COLUMN name=&quot;UNITSEL&quot; length=&quot;22&quot; /> </RECORD></PZMAP> </property> </class>
  12. 16. Transforming using E4X
  13. 17. Scripting XML with E4X <script language=&quot;js&quot;><![CDATA[ var rowset = mc.getPayloadXML() /* use the default namespace from the Flatpack mediator */ var ns = new Namespace(&quot;;); /* find all the D6 rows */ var d6 = rowset..ns::row.(@recordname==&quot;D6&quot;); /* create a holder element for the <FEED> elements */ var output = <FEEDS/> for (var i=0; i<d6.length(); i++) { var row = d6[i]; /* lookup the important data */ var ActionKey = row.ns::entry.(@name==&quot;ACTIONKEY&quot;).text(); var AccNum = row.ns::entry.(@name==&quot;ACCNUM&quot;).text(); var ActType = row.ns::entry.(@name==&quot;ACTTYPE&quot;).text(); var SecID = row.ns::entry.(@name==&quot;SECID&quot;).text(); var SecIDType = row.ns::entry.(@name==&quot;SECIDTYPE&quot;).text(); var ONVF = row.ns::entry.(@name==&quot;ONVF&quot;).text(); var UnitsEl = row.ns::entry.(@name==&quot;UNITSEL&quot;).text(); var RegCode = row.ns::entry.(@name==&quot;REGCODE&quot;).text();
  14. 18. Scripting XML continued var feed = <FEED> <ActionKey>{ActionKey}</ActionKey> <AccountNumber>{AccNum}</AccountNumber> <ActionType>{AccType}</ActionType> <SecurityID>{SecID}</SecurityID> <SecurityIDType>{SecIDType}</SecurityIDType> <ONVF>{ONVF}</ONVF> <UnitsElected>{UnitsEl}</UnitsElected> <RegCode>{RegCode}</RegCode> </FEED>; output.appendChild(feed); } mc.setPayloadXML(output); ]]> </script>
  15. 19. London - Iterate
  16. 20. Log the whole message
  17. 21. Final steps
  18. 22. PushMePullYou
  19. 23. Pull n Push scenario
  20. 24. Task Configuration specify the task implementation task properties task scheduler configuration
  21. 25. Calling the data service external data service endpoint configuration
  22. 26. Calling Clearance Service split the message into number of messages transform the individual messages clearance service endpoint
  23. 27. Clearance Response transform the responses from the clearance service aggregate the responses from the clearance into one response
  24. 28. Summary <ul><li>Covered a set of useful cases </li></ul><ul><ul><li>Changing the flow of control </li></ul></ul><ul><ul><li>Iteration and Aggregation </li></ul></ul><ul><ul><li>Two ways of transforming XML </li></ul></ul><ul><ul><li>Reading record formats </li></ul></ul><ul><ul><li>Integrating with File-based systems </li></ul></ul><ul><ul><li>DBReport and DBLookup </li></ul></ul>
  25. 29. Questions
  26. 30. Resources <ul><li>WSO2 Webinars </li></ul><ul><ul><li> </li></ul></ul><ul><li>WSO2 ESB documentation </li></ul><ul><ul><li> </li></ul></ul><ul><li>User List </li></ul><ul><ul><li>[email_address] </li></ul></ul><ul><li>Recent performance testing </li></ul><ul><ul><li> </li></ul></ul>