Multicast - CPI
Multicast - CPI
Defining Multicast
You can use the Multicast step to send copies of the same message to multiple routes. You can
send copies to all routes at once using Parallel Multicast or in an order of your choice
using Sequential Multicast. This allows you to perform multiple operations on the same message in
a single integration process. Without Multicast, you needed multiple integration processes to
perform this task.
1) https://blogs.sap.com/2015/01/06/blog-3-multicast-pattern-in-integration-flows-hci-pi/
The Multicast pattern allows to route the same message to a number of endpoints and process them
in a different way.
To understand the multicast pattern better, I shall take the example an Integration Flow and insert a
Content Modifier step with a sample XML Payload in its body (shown below). In addition, I shall use
a simple mapping step that converts the price and currency from Dollars to Euros.
What ways can I use the Multicast pattern?
In Integration projects so far, we have seen its usage in the following two ways:
Use case 1: Send the message to multiple receivers. A simplified integration flow is shown below.
Use case 2: Multiple branches of the integration flow requires the same message contents
There are cases when you require the same message in different branches of the integration flow.
This is a pattern also observed in the SuccessFactors scenario integration with 3rd party systems. In
this case, you have to use the Join and Gather step. This shall collect all messages from different
branches into one message.Example below:
Note: You have to use the Join + Gather step together. A Gather step alone shall not work.
The Gather step enables you to merge messages from more than one route in an integration
process. You define conditions based on the type of messages that you are gathering using the
Gather step. You can choose to gather:
Based on this, you choose the strategy to combine the two messages:
1. XML messages of the same format, you can combine or specify the XPath to the node at
which the messages have to be combined.
2. XML messages of different formats, you can only combine the messages
3. Plain text messages, you can only specify concatenation as the combine strategy
So, here I want to combine all the “<part>”nodes and group it under the main “Mobile_menu” node.
Understanding the aggregation strategy can get a little tricky. I would recommend playing around it
with different values to get a hand on it.