SlideShare une entreprise Scribd logo
1  sur  30
Real world scenarios with the WSO2 ESB Paul Fremantle, CTO Asankha Perera, ESB Architect Ruwan Linton, Senior Software Engineer 1 st  July 2008
ESB 1.7 Webinar Series ,[object Object],[object Object],[object Object],[object Object],[object Object]
Three real world scenarios in some detail ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
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 http://esbsite.org/resources.jsp?path=/mediators/paulfremantle/FlatPackMediator   <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>
Transforming using E4X
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;http://ws.apache.org/synapse/ns/rowset&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();
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>
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 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Questions
Resources ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

Contenu connexe

Tendances

Boost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
Boost Your Environment With XMLDB - UKOUG 2008 - Marco GralikeBoost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
Boost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
Marco Gralike
 
Chapter 4 2
Chapter 4 2Chapter 4 2
Chapter 4 2
lopjuan
 

Tendances (20)

SFScon 2020 - Peter Hopfgartner - Open Data de luxe
SFScon 2020 - Peter Hopfgartner - Open Data de luxeSFScon 2020 - Peter Hopfgartner - Open Data de luxe
SFScon 2020 - Peter Hopfgartner - Open Data de luxe
 
Boost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
Boost Your Environment With XMLDB - UKOUG 2008 - Marco GralikeBoost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
Boost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
 
Shell Script to Extract IP Address, MAC Address Information
Shell Script to Extract IP Address, MAC Address InformationShell Script to Extract IP Address, MAC Address Information
Shell Script to Extract IP Address, MAC Address Information
 
Code
CodeCode
Code
 
Postgresql Database Administration- Day4
Postgresql Database Administration- Day4Postgresql Database Administration- Day4
Postgresql Database Administration- Day4
 
Chapter 4 2
Chapter 4 2Chapter 4 2
Chapter 4 2
 
File Management in C
File Management in CFile Management in C
File Management in C
 
SQLite Techniques
SQLite TechniquesSQLite Techniques
SQLite Techniques
 
Overloading Perl OPs using XS
Overloading Perl OPs using XSOverloading Perl OPs using XS
Overloading Perl OPs using XS
 
Whitepaper To Study Filestream Option In Sql Server
Whitepaper To Study Filestream Option In Sql ServerWhitepaper To Study Filestream Option In Sql Server
Whitepaper To Study Filestream Option In Sql Server
 
Data File Handiling File POINTERS IN C++
Data File Handiling File POINTERS IN C++Data File Handiling File POINTERS IN C++
Data File Handiling File POINTERS IN C++
 
Async task
Async taskAsync task
Async task
 
Adodb Pdo Presentation
Adodb Pdo PresentationAdodb Pdo Presentation
Adodb Pdo Presentation
 
System performance tuning
System performance tuningSystem performance tuning
System performance tuning
 
File handling in c
File handling in cFile handling in c
File handling in c
 
Linux intro 4 awk + makefile
Linux intro 4  awk + makefileLinux intro 4  awk + makefile
Linux intro 4 awk + makefile
 
C programming file handling
C  programming file handlingC  programming file handling
C programming file handling
 
Scoop Job, import and export to RDBMS
Scoop Job, import and export to RDBMSScoop Job, import and export to RDBMS
Scoop Job, import and export to RDBMS
 
File in C language
File in C languageFile in C language
File in C language
 
Adaptive Query Processing on RAW Data
Adaptive Query Processing on RAW DataAdaptive Query Processing on RAW Data
Adaptive Query Processing on RAW Data
 

Similaire à Wso2 Scenarios Esb Webinar July 1st

IQPC Canada XML 2001: How to Use XML Parsing to Enhance Electronic Communication
IQPC Canada XML 2001: How to Use XML Parsing to Enhance Electronic CommunicationIQPC Canada XML 2001: How to Use XML Parsing to Enhance Electronic Communication
IQPC Canada XML 2001: How to Use XML Parsing to Enhance Electronic Communication
Ted Leung
 
ApacheCon 2000 Everything you ever wanted to know about XML Parsing
ApacheCon 2000 Everything you ever wanted to know about XML ParsingApacheCon 2000 Everything you ever wanted to know about XML Parsing
ApacheCon 2000 Everything you ever wanted to know about XML Parsing
Ted Leung
 
Architecting Web Services
Architecting Web ServicesArchitecting Web Services
Architecting Web Services
Lorna Mitchell
 
OWB11gR2 - Extending ETL
OWB11gR2 - Extending ETL OWB11gR2 - Extending ETL
OWB11gR2 - Extending ETL
Suraj Bang
 

Similaire à Wso2 Scenarios Esb Webinar July 1st (20)

Fast SOA with Apache Synapse
Fast SOA with Apache SynapseFast SOA with Apache Synapse
Fast SOA with Apache Synapse
 
Processing XML with Java
Processing XML with JavaProcessing XML with Java
Processing XML with Java
 
IQPC Canada XML 2001: How to Use XML Parsing to Enhance Electronic Communication
IQPC Canada XML 2001: How to Use XML Parsing to Enhance Electronic CommunicationIQPC Canada XML 2001: How to Use XML Parsing to Enhance Electronic Communication
IQPC Canada XML 2001: How to Use XML Parsing to Enhance Electronic Communication
 
Complex Event Processing with Esper and WSO2 ESB
Complex Event Processing with Esper and WSO2 ESBComplex Event Processing with Esper and WSO2 ESB
Complex Event Processing with Esper and WSO2 ESB
 
Interoperable Web Services with JAX-WS
Interoperable Web Services with JAX-WSInteroperable Web Services with JAX-WS
Interoperable Web Services with JAX-WS
 
XPath - XML Path Language
XPath - XML Path LanguageXPath - XML Path Language
XPath - XML Path Language
 
ApacheCon 2000 Everything you ever wanted to know about XML Parsing
ApacheCon 2000 Everything you ever wanted to know about XML ParsingApacheCon 2000 Everything you ever wanted to know about XML Parsing
ApacheCon 2000 Everything you ever wanted to know about XML Parsing
 
6 311 W
6 311 W6 311 W
6 311 W
 
6 311 W
6 311 W6 311 W
6 311 W
 
test
testtest
test
 
Sax Dom Tutorial
Sax Dom TutorialSax Dom Tutorial
Sax Dom Tutorial
 
SPARQLing Services
SPARQLing ServicesSPARQLing Services
SPARQLing Services
 
Architecting Web Services
Architecting Web ServicesArchitecting Web Services
Architecting Web Services
 
Entity Persistence with JPA
Entity Persistence with JPAEntity Persistence with JPA
Entity Persistence with JPA
 
Don't Be Afraid of Abstract Syntax Trees
Don't Be Afraid of Abstract Syntax TreesDon't Be Afraid of Abstract Syntax Trees
Don't Be Afraid of Abstract Syntax Trees
 
Zend framework 05 - ajax, json and j query
Zend framework 05 - ajax, json and j queryZend framework 05 - ajax, json and j query
Zend framework 05 - ajax, json and j query
 
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2
 
Odp
OdpOdp
Odp
 
REST dojo Comet
REST dojo CometREST dojo Comet
REST dojo Comet
 
OWB11gR2 - Extending ETL
OWB11gR2 - Extending ETL OWB11gR2 - Extending ETL
OWB11gR2 - Extending ETL
 

Plus de WSO2

Plus de WSO2 (20)

Driving Innovation: Scania's API Revolution with WSO2
Driving Innovation: Scania's API Revolution with WSO2Driving Innovation: Scania's API Revolution with WSO2
Driving Innovation: Scania's API Revolution with WSO2
 
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformLess Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using Ballerina
 
WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...
WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...
WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...
 
WSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AIWSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AI
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation Computing
 
WSO2CON 2024 - Elevating the Integration Game to the Cloud
WSO2CON 2024 - Elevating the Integration Game to the CloudWSO2CON 2024 - Elevating the Integration Game to the Cloud
WSO2CON 2024 - Elevating the Integration Game to the Cloud
 
WSO2CON 2024 - OSU & WSO2: A Decade Journey in Integration & Innovation
WSO2CON 2024 - OSU & WSO2: A Decade Journey in Integration & InnovationWSO2CON 2024 - OSU & WSO2: A Decade Journey in Integration & Innovation
WSO2CON 2024 - OSU & WSO2: A Decade Journey in Integration & Innovation
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...
WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...
WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...
 
WSO2CON 2024 - Architecting AI in the Enterprise: APIs and Applications
WSO2CON 2024 - Architecting AI in the Enterprise: APIs and ApplicationsWSO2CON 2024 - Architecting AI in the Enterprise: APIs and Applications
WSO2CON 2024 - Architecting AI in the Enterprise: APIs and Applications
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
WSO2CON 2024 - Software Engineering for Digital Businesses
WSO2CON 2024 - Software Engineering for Digital BusinessesWSO2CON 2024 - Software Engineering for Digital Businesses
WSO2CON 2024 - Software Engineering for Digital Businesses
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
WSO2CON 2024 - Designing Event-Driven Enterprises: Stories of Transformation
WSO2CON 2024 - Designing Event-Driven Enterprises: Stories of TransformationWSO2CON 2024 - Designing Event-Driven Enterprises: Stories of Transformation
WSO2CON 2024 - Designing Event-Driven Enterprises: Stories of Transformation
 
WSO2CON 2024 - Not Just Microservices: Rightsize Your Services!
WSO2CON 2024 - Not Just Microservices: Rightsize Your Services!WSO2CON 2024 - Not Just Microservices: Rightsize Your Services!
WSO2CON 2024 - Not Just Microservices: Rightsize Your Services!
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 

Dernier

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Dernier (20)

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 

Wso2 Scenarios Esb Webinar July 1st

  • 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.
  • 3.
  • 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
  • 7.  
  • 8.  
  • 9.  
  • 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
  • 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
  • 13. New York – File System Listener
  • 15. Flatpack Mediator http://esbsite.org/resources.jsp?path=/mediators/paulfremantle/FlatPackMediator <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>
  • 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;http://ws.apache.org/synapse/ns/rowset&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();
  • 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>
  • 20. Log the whole message
  • 23. Pull n Push scenario
  • 24. Task Configuration specify the task implementation task properties task scheduler configuration
  • 25. Calling the data service external data service endpoint configuration
  • 26. Calling Clearance Service split the message into number of messages transform the individual messages clearance service endpoint
  • 27. Clearance Response transform the responses from the clearance service aggregate the responses from the clearance into one response
  • 28.
  • 30.