SlideShare a Scribd company logo
1 of 14
Integration Pattern
Splitter and Aggregators
Introduction
• Messages passing through an integration solution consist of multiple elements.
• E.g. an order placed by a customer typically consists of more than just a single items like Address, Product
details , Mode Of Payment etc.
• We should process a complete order but treat each order item contained in the order
individually
• How can we process a message having multiple elements, each of which may have to
be processed in a different way?
• Publish Subscriber Model ????
Page 2
Publish Subscriber an alternative to Splitter ?
• Publish a message having Multiple Orders to All Subscribers
• Each Subscriber would process the required/supported Order and discard other orders
• Inefficient
• Each subscriber needs to implement logic to divide whole message and process supported one
• Increase Network Traffic
• Implement extra logic for lost / duplicate message handling
Page 3
Splitter
• Use a Splitter to break out the composite message into a series of individual messages, each containing
data related to one item.
• To avoid sending the complete message multiple times
• Split them into multiple
• Each message would then contain only one items
• The Splitter publishes one message for each single element
Page 4
Splitter -Handling Common Elements
• In many cases, we repeat some common elements in each resulting message
• These extra elements might be required to make the resulting child message self-contained and enable stateless
processing of each child message
• It also allows reconciliation of associated child messages later on
• Common Element can be Some ID or Timestamp
Page 5
Iterative Splitter
• When Data in Message is stored in a Data Structure like Lists , Tree Or Map
• Then Splitter iterates over each records/Node and constructs the output
• Generic Splitter can be worked with any number of child elements
• Also Called Sequencer Splitter
Page 6
Static Splitter
• Customized Splitter
• Used to split a large message into smaller messages based on some criteria e.g.
subtype
• Usually it splits into Fixed number of messages
• The strategy of splitting is fixed hence its called static Splitter
Page 7
Splitter -Input Message
• <order>
<date>7/18/2002</date>
<ordernumber>3825968</ordernumber>
<customer>
<id>12345</id>
<name>Joe Doe</name>
</customer>
<orderitems>
<item>
<quantity>3.0</quantity>
<itemno>W1234</itemno>
<description>A Widget</description>
</item>
<item>
<quantity>2.0</quantity>
<itemno>G2345</itemno>
<description>A Gadget</description>
</item>
</orderitems>
</order>
Page 8
Splitter – Output Messages
• <orderitem>
<date>7/18/2002</date>
<ordernumber>3825968</ordernumber>
<customerid>12345</customerid>
<quantity>3.0</quantity>
<itemno>W1234</itemno>
<description>A Widget</description>
</orderitem>
<orderitem>
<date>7/18/2002</date>
<ordernumber>3825968</ordernumber>
<customerid>12345</customerid>
<quantity>2.0</quantity>
<itemno>G2345</itemno>
<description>A Gadget</description>
</orderitem>
Page 9
Aggregator
• Splitter splits single message into sequence of individual messages
• How can we combine results of individual but related messages ?
• Asynchronous behavior
• Unknown number of recipients
• Response of individual message may be out of sequence
• How long should we wait ?
• Wait for too long ?
• Set timeout
• What should we do when response of few message is pending
• Should we send incomplete information ?
Page
10
Aggregator
• A separate component which sends a single message Once all individual message response is
ready
• Its called Aggregator because it collects individual messages until it receives a complete set and
then it combines and sends a single message
• Special filter
• which receives stream of messages It identifies the related messages . Once a complete set is arrived it sends
to output channel
Page
11
• Stateful component
• It needs to store all incoming messages(some information)
• Design
1. Correlation: Which incoming messages belong together
 ID, Timestamp etc
2. Completeness Condition: When are we ready to publish the result message?
3. Aggregation Algorithm: How do we combine the received messages into a single result
message ?
Page
12
Aggregator
Aggregator Implementation
Page
13
Message
First
Message
?
Aggregator
Yes
Message
Correlatio
n exists
No
Aggregator
No
Create
Aggregator and
add message
Add Message to
Existing
Aggregator
Create
Aggregator and
add message
Complete
Set
Received
Yes
Aggregate and
Construct
Single Message
No
Wait till all messages received
System
Send
message
References
• Enterprise Integration Patterns a Book by Gregor Hohpe

More Related Content

What's hot

Métricas e Indicadores em Projetos Ágeis
Métricas e Indicadores em Projetos ÁgeisMétricas e Indicadores em Projetos Ágeis
Métricas e Indicadores em Projetos ÁgeisVitor Pelizza
 
Penilaian berbasis kompetensi
Penilaian  berbasis kompetensiPenilaian  berbasis kompetensi
Penilaian berbasis kompetensiAnton Sunarto
 
Aula 03 SGQ ISO 9001:2015 – Capítulos 1 e 2
Aula 03 SGQ ISO 9001:2015 – Capítulos 1 e 2Aula 03 SGQ ISO 9001:2015 – Capítulos 1 e 2
Aula 03 SGQ ISO 9001:2015 – Capítulos 1 e 2Claudio Bernardi Stringari
 
World Agile Summit 2020 - Health Check: a dinâmica que mede a saúde de um tim...
World Agile Summit 2020 - Health Check: a dinâmica que mede a saúde de um tim...World Agile Summit 2020 - Health Check: a dinâmica que mede a saúde de um tim...
World Agile Summit 2020 - Health Check: a dinâmica que mede a saúde de um tim...Annelise Gripp
 
Apresentacao mudanças ISO 9001:2015
Apresentacao mudanças ISO 9001:2015Apresentacao mudanças ISO 9001:2015
Apresentacao mudanças ISO 9001:2015Adeildo Caboclo
 
Gestão da Qualidade ISO:9001
Gestão da Qualidade ISO:9001Gestão da Qualidade ISO:9001
Gestão da Qualidade ISO:9001Greice Marques
 
02 histórico da gestão da qualidade
02 histórico da gestão da qualidade02 histórico da gestão da qualidade
02 histórico da gestão da qualidadeReginaldo Borges
 
Estrutura Analítica do Projeto (EAP)
Estrutura Analítica do Projeto (EAP)Estrutura Analítica do Projeto (EAP)
Estrutura Analítica do Projeto (EAP)Alessandro Fazenda
 

What's hot (13)

Métricas e Indicadores em Projetos Ágeis
Métricas e Indicadores em Projetos ÁgeisMétricas e Indicadores em Projetos Ágeis
Métricas e Indicadores em Projetos Ágeis
 
Gestao agil de projetos
Gestao agil de projetosGestao agil de projetos
Gestao agil de projetos
 
Penilaian berbasis kompetensi
Penilaian  berbasis kompetensiPenilaian  berbasis kompetensi
Penilaian berbasis kompetensi
 
Aula 03 SGQ ISO 9001:2015 – Capítulos 1 e 2
Aula 03 SGQ ISO 9001:2015 – Capítulos 1 e 2Aula 03 SGQ ISO 9001:2015 – Capítulos 1 e 2
Aula 03 SGQ ISO 9001:2015 – Capítulos 1 e 2
 
World Agile Summit 2020 - Health Check: a dinâmica que mede a saúde de um tim...
World Agile Summit 2020 - Health Check: a dinâmica que mede a saúde de um tim...World Agile Summit 2020 - Health Check: a dinâmica que mede a saúde de um tim...
World Agile Summit 2020 - Health Check: a dinâmica que mede a saúde de um tim...
 
Avaliação de Projetos
Avaliação de ProjetosAvaliação de Projetos
Avaliação de Projetos
 
Apresentacao mudanças ISO 9001:2015
Apresentacao mudanças ISO 9001:2015Apresentacao mudanças ISO 9001:2015
Apresentacao mudanças ISO 9001:2015
 
Gestão da Qualidade ISO:9001
Gestão da Qualidade ISO:9001Gestão da Qualidade ISO:9001
Gestão da Qualidade ISO:9001
 
02 histórico da gestão da qualidade
02 histórico da gestão da qualidade02 histórico da gestão da qualidade
02 histórico da gestão da qualidade
 
ArchiMate 3.0 Overview
ArchiMate 3.0 OverviewArchiMate 3.0 Overview
ArchiMate 3.0 Overview
 
Estrutura Analítica do Projeto (EAP)
Estrutura Analítica do Projeto (EAP)Estrutura Analítica do Projeto (EAP)
Estrutura Analítica do Projeto (EAP)
 
Capitulo1
Capitulo1Capitulo1
Capitulo1
 
Aula 04 SGQ ISO 9001:2015 – Seções 4 e 5
Aula 04 SGQ ISO 9001:2015 – Seções 4 e 5Aula 04 SGQ ISO 9001:2015 – Seções 4 e 5
Aula 04 SGQ ISO 9001:2015 – Seções 4 e 5
 

Similar to Integration Pattern Splitter and Aggregators

Mastery Webinar Series: Strategies to Simplify Email Data Management
Mastery Webinar Series: Strategies to Simplify Email Data ManagementMastery Webinar Series: Strategies to Simplify Email Data Management
Mastery Webinar Series: Strategies to Simplify Email Data ManagementVaultastic
 
FOSSASIA 2016 - 7 Tips to design web centric high-performance applications
FOSSASIA 2016 - 7 Tips to design web centric high-performance applicationsFOSSASIA 2016 - 7 Tips to design web centric high-performance applications
FOSSASIA 2016 - 7 Tips to design web centric high-performance applicationsAshnikbiz
 
Publish Subscriber messaging pattern
Publish Subscriber messaging patternPublish Subscriber messaging pattern
Publish Subscriber messaging patternShirish Bari
 
SOA Pattern-Asynchronous Queuing
SOA Pattern-Asynchronous QueuingSOA Pattern-Asynchronous Queuing
SOA Pattern-Asynchronous QueuingWSO2
 
Building an Event Bus at Scale
Building an Event Bus at ScaleBuilding an Event Bus at Scale
Building an Event Bus at Scalejimriecken
 
Object Oriented Design
Object Oriented Design Object Oriented Design
Object Oriented Design DivyaSure
 
5 email data management strategies and choosing the right one
5 email data management strategies and choosing the right one5 email data management strategies and choosing the right one
5 email data management strategies and choosing the right oneVaultastic
 
“Controlling of messages flow in Microservices architecture” by Andris Lubans...
“Controlling of messages flow in Microservices architecture” by Andris Lubans...“Controlling of messages flow in Microservices architecture” by Andris Lubans...
“Controlling of messages flow in Microservices architecture” by Andris Lubans...DevClub_lv
 
Apache kafka- Onkar Kadam
Apache kafka- Onkar KadamApache kafka- Onkar Kadam
Apache kafka- Onkar KadamOnkar Kadam
 
IBM MQ: An Introduction to Using and Developing with MQ Publish/Subscribe
IBM MQ: An Introduction to Using and Developing with MQ Publish/SubscribeIBM MQ: An Introduction to Using and Developing with MQ Publish/Subscribe
IBM MQ: An Introduction to Using and Developing with MQ Publish/SubscribeDavid Ware
 
Redis Day TLV 2018 - My Other Car is a Redis
Redis Day TLV 2018 - My Other Car is a RedisRedis Day TLV 2018 - My Other Car is a Redis
Redis Day TLV 2018 - My Other Car is a RedisRedis Labs
 

Similar to Integration Pattern Splitter and Aggregators (20)

Mastery Webinar Series: Strategies to Simplify Email Data Management
Mastery Webinar Series: Strategies to Simplify Email Data ManagementMastery Webinar Series: Strategies to Simplify Email Data Management
Mastery Webinar Series: Strategies to Simplify Email Data Management
 
FOSSASIA 2016 - 7 Tips to design web centric high-performance applications
FOSSASIA 2016 - 7 Tips to design web centric high-performance applicationsFOSSASIA 2016 - 7 Tips to design web centric high-performance applications
FOSSASIA 2016 - 7 Tips to design web centric high-performance applications
 
Publish Subscriber messaging pattern
Publish Subscriber messaging patternPublish Subscriber messaging pattern
Publish Subscriber messaging pattern
 
SOA Pattern-Asynchronous Queuing
SOA Pattern-Asynchronous QueuingSOA Pattern-Asynchronous Queuing
SOA Pattern-Asynchronous Queuing
 
Building an Event Bus at Scale
Building an Event Bus at ScaleBuilding an Event Bus at Scale
Building an Event Bus at Scale
 
M split
M splitM split
M split
 
Object Oriented Design
Object Oriented Design Object Oriented Design
Object Oriented Design
 
5 email data management strategies and choosing the right one
5 email data management strategies and choosing the right one5 email data management strategies and choosing the right one
5 email data management strategies and choosing the right one
 
“Controlling of messages flow in Microservices architecture” by Andris Lubans...
“Controlling of messages flow in Microservices architecture” by Andris Lubans...“Controlling of messages flow in Microservices architecture” by Andris Lubans...
“Controlling of messages flow in Microservices architecture” by Andris Lubans...
 
test
testtest
test
 
test
testtest
test
 
test
testtest
test
 
test
testtest
test
 
test
testtest
test
 
test
testtest
test
 
test
testtest
test
 
test
testtest
test
 
Apache kafka- Onkar Kadam
Apache kafka- Onkar KadamApache kafka- Onkar Kadam
Apache kafka- Onkar Kadam
 
IBM MQ: An Introduction to Using and Developing with MQ Publish/Subscribe
IBM MQ: An Introduction to Using and Developing with MQ Publish/SubscribeIBM MQ: An Introduction to Using and Developing with MQ Publish/Subscribe
IBM MQ: An Introduction to Using and Developing with MQ Publish/Subscribe
 
Redis Day TLV 2018 - My Other Car is a Redis
Redis Day TLV 2018 - My Other Car is a RedisRedis Day TLV 2018 - My Other Car is a Redis
Redis Day TLV 2018 - My Other Car is a Redis
 

Recently uploaded

Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 

Recently uploaded (20)

Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 

Integration Pattern Splitter and Aggregators

  • 2. Introduction • Messages passing through an integration solution consist of multiple elements. • E.g. an order placed by a customer typically consists of more than just a single items like Address, Product details , Mode Of Payment etc. • We should process a complete order but treat each order item contained in the order individually • How can we process a message having multiple elements, each of which may have to be processed in a different way? • Publish Subscriber Model ???? Page 2
  • 3. Publish Subscriber an alternative to Splitter ? • Publish a message having Multiple Orders to All Subscribers • Each Subscriber would process the required/supported Order and discard other orders • Inefficient • Each subscriber needs to implement logic to divide whole message and process supported one • Increase Network Traffic • Implement extra logic for lost / duplicate message handling Page 3
  • 4. Splitter • Use a Splitter to break out the composite message into a series of individual messages, each containing data related to one item. • To avoid sending the complete message multiple times • Split them into multiple • Each message would then contain only one items • The Splitter publishes one message for each single element Page 4
  • 5. Splitter -Handling Common Elements • In many cases, we repeat some common elements in each resulting message • These extra elements might be required to make the resulting child message self-contained and enable stateless processing of each child message • It also allows reconciliation of associated child messages later on • Common Element can be Some ID or Timestamp Page 5
  • 6. Iterative Splitter • When Data in Message is stored in a Data Structure like Lists , Tree Or Map • Then Splitter iterates over each records/Node and constructs the output • Generic Splitter can be worked with any number of child elements • Also Called Sequencer Splitter Page 6
  • 7. Static Splitter • Customized Splitter • Used to split a large message into smaller messages based on some criteria e.g. subtype • Usually it splits into Fixed number of messages • The strategy of splitting is fixed hence its called static Splitter Page 7
  • 8. Splitter -Input Message • <order> <date>7/18/2002</date> <ordernumber>3825968</ordernumber> <customer> <id>12345</id> <name>Joe Doe</name> </customer> <orderitems> <item> <quantity>3.0</quantity> <itemno>W1234</itemno> <description>A Widget</description> </item> <item> <quantity>2.0</quantity> <itemno>G2345</itemno> <description>A Gadget</description> </item> </orderitems> </order> Page 8
  • 9. Splitter – Output Messages • <orderitem> <date>7/18/2002</date> <ordernumber>3825968</ordernumber> <customerid>12345</customerid> <quantity>3.0</quantity> <itemno>W1234</itemno> <description>A Widget</description> </orderitem> <orderitem> <date>7/18/2002</date> <ordernumber>3825968</ordernumber> <customerid>12345</customerid> <quantity>2.0</quantity> <itemno>G2345</itemno> <description>A Gadget</description> </orderitem> Page 9
  • 10. Aggregator • Splitter splits single message into sequence of individual messages • How can we combine results of individual but related messages ? • Asynchronous behavior • Unknown number of recipients • Response of individual message may be out of sequence • How long should we wait ? • Wait for too long ? • Set timeout • What should we do when response of few message is pending • Should we send incomplete information ? Page 10
  • 11. Aggregator • A separate component which sends a single message Once all individual message response is ready • Its called Aggregator because it collects individual messages until it receives a complete set and then it combines and sends a single message • Special filter • which receives stream of messages It identifies the related messages . Once a complete set is arrived it sends to output channel Page 11
  • 12. • Stateful component • It needs to store all incoming messages(some information) • Design 1. Correlation: Which incoming messages belong together  ID, Timestamp etc 2. Completeness Condition: When are we ready to publish the result message? 3. Aggregation Algorithm: How do we combine the received messages into a single result message ? Page 12 Aggregator
  • 13. Aggregator Implementation Page 13 Message First Message ? Aggregator Yes Message Correlatio n exists No Aggregator No Create Aggregator and add message Add Message to Existing Aggregator Create Aggregator and add message Complete Set Received Yes Aggregate and Construct Single Message No Wait till all messages received System Send message
  • 14. References • Enterprise Integration Patterns a Book by Gregor Hohpe