Enterprise Integration Patterns at SAP Cloud Platform Integration: Recipient List
In my last blog, I showed you the Content-Based Router pattern where you route a message to the correct recipient based on its content. The Recipient List pattern is similar to this pattern however whereas for the Content-Based Router a message is routed to exactly one channel, with the Recipient List we route a message to a dynamic list of recipients.
This blog is part of a blog series where I show you how to model most common Enterprise Integration Patterns on both SAP Process Orchestration and SAP Cloud Platform Integration. If you like to find out more about the motivation and use cases for the patterns blog series, start with the Enterprise Integration Patterns at SAP Cloud Platform Integration: Scatter-Gather blog. Also, check out the Integration Flow Design Guidelines for SAP Cloud Platform Integration blog referring to integration flow design guidelines and patterns for SAP Cloud Platform Integration that SAP has recently published on the SAP Help Portal.
So, let’s focus now on the Recipient List pattern.
Recipient List on SAP Process Orchestration
Similar to the Content-Based Routing, you model the Recipient List pattern using a Recipient List within the integration flow. When maintaining the list of potential receivers, you have the possibility to select either of the following routing techniques: dynamic (via message mapping), static (an xpath condition either based on the payload data or the message header), and receiver rules (re-usable routing conditions).
Other than for the Content-Based Router, here the routing conditions do not have to be disjoint, and hence the same message may be routed to multiple receivers.
In the example below, we stick to the dynamic routing condition in combination with the receiver wildcard. As you can see in figure below, we have chosen the Dynamic Message Router as Routing Technique and have selected the Allow arbitrary receivers flag.
On the Dynamic Routing tab, we have selected a message mapping which is carried out to determine the receivers the message should be routed to.
For each potential receiver, we need to create a receiver agreement. This way you can add new receivers without the need of changing and re-deploying the integration flow. When selecting the receiver in the integration flow model, on tab Receivers you get a list of receiver agreement displayed which fit to the particular integration flow.
See also the Recipient List chapter in the Stateless Enterprise Integration Patterns on SAP Process Orchestration paper. Although, in the paper we do not cover the receiver wildcard. Actually, at the time the paper was published, the receiver wildcard of an integration flow was not supported. Support for receiver wildcards within integration flows have been shipped with release 7.5 SP06.
Recipient List on SAP Cloud Platform Integration
The Recipient List pattern is modeled using the same message mapping that we have used for SAP Process Orchestration above. See how message mappings can be imported from an Enterprise Service Repository within this blog. The message mapping returns a list of receivers which is then split using an Iterating splitter flow step. For each split item, the message is then routed to another integration flow via Process Direct adapter. The Process Direct address is dynamically determined based on the mapping outcome.
For each potential receiver, we create an own integration flow. This would correspond to a receiver agreement in SAP Process Orchestration as seen above. By decoupling the main integration flow from the receiver specific message delivery, we do not need to maintain a fixed number of receivers in the main integration flow. Furthermore, other than for the receiver wildcard in SAP Process Orchestration, each receiver can have a different receiver specific mapping or other receiver specific flow steps.
For a detailed description of the Recipient List pattern on SAP Cloud Platform Integration, please check out the SAP Help Portal. There we also have described another variant of the Recipient List pattern with static routing.
On the SAP API Business Hub, you can access the pattern in the Integration Flow Design Guidelines – Enterprise Integration Patterns package. You can either test the pattern on your SAP Cloud Platform Integration tenant or optionally on the cloud integration runtime inside an SAP Process Orchestration 7.5 system. For latter, check out this blog.
If you like to learn more about the patterns, check out the following blogs: