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
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