Using Integration Patterns

Objective

After completing this lesson, you will be able to use integration patterns

Integration Patterns

In this Lesson, the Following Topic is Discussed:

Show Integration Patterns.

Show Integration Patterns

The following Integration Patterns are included in the example package:

The Integration Patterns in Detail:

Aggregator

To process related individual messages in bulk, you can use an Aggregator pattern. This pattern involves collecting and storing individual messages until a complete set of related messages is received. The aggregated message is then sent to the intended receiver.

Screenshot of the Aggregator.
Composed Message Processor

The Composed Message Processor pattern is useful when you must process a message that contains multiple elements, each requiring different processing. The pattern involves splitting the message into submessages, routing each submessage to a different destination, and then reaggregating the responses back into a single message.

Screenshot of the composed message processor.
Content-Based Routing

Assuming you have an order process in which the inventory system handling the order depends on the shipping address, you can use content-based routing to direct the message to the appropriate recipient based on its content. In this exercise, we use a content-based router.

Read more here:

Content Enricher

Suppose you must send an order to a supplier, but you don't have all the required information for the receiver system to process it. For example, the product items only have a category code, and the main category name is missing. In this case, you can use a Content Enricher pattern that reads data synchronously from an external system and appends the missing information to the original message before forwarding it to the receiver.

Screenshot of the Content Enricher.
Content Filter

Assuming you receive an order from a partner in a standardized format with many fields, but your backend system only needs a small fraction of them. You have two options to implement this scenario:

  • Using a Filter step.
  • Using Message Mapping.

Read more here:

Message Filter

You can implement the Message Filter pattern to remove unwanted data from a channel. For example, if you must send product information to an inventory system, but the inventory system only handles a specific range of products based on product category, you can apply a Message Filter to discard any irrelevant data. The Message Filter is a subtype of the Message Router pattern, with only one receiver channel. It evaluates incoming messages and routes them to the receiver channel only if they meet the specified criteria; otherwise, they are discarded.

Screenshot of the Message Filter.
Recipient List

Assuming that you want to find the best quote for an order by sending it to several suppliers, but not all suppliers are relevant for every product in the order. In this case, the suppliers that should receive the order are dynamically determined based on the specific products being ordered. To achieve this, you can use the Dynamic Router pattern, which sends a copy of the message to multiple receivers based on dynamically determined criteria. Unlike the content-based router, which forwards the original message to a single receiver, the dynamic router sends a copy of the message to multiple receivers.

Read more here:

Resequencer

If you must rearrange messages that were received by Cloud Integration in an incorrect order, you can employ the Aggregator pattern. This pattern enables you to gather individual messages in batches that are sorted by sequence number. To transform the message batches back into separate messages, you can use the Splitter pattern and send the individual messages to the intended receiver.

Screenshot of the Resequencer.
Scatter-Gather

The Scatter-Gather pattern allows you to send a message to multiple recipients and collect their replies. By broadcasting a message to multiple recipients, the pattern enables parallel processing of the message by all recipients. After receiving the responses, the pattern reaggregates them back into a single message.

Screenshot of the Scatter-Gather.
Splitter

The Splitter pattern can be used when a message contains multiple elements that require different processing. The pattern can break up the message into individual messages based on the number of elements. However, in the given exercise, the Splitter pattern is not used.

A distinction is made between the following use cases:

  • Splitting a bulk order message into multiple orders.
  • Splitting a single order with multiple items.

Read more here:

Quality of Service Exactly Once

You want to guarantee that a message is delivered and processed by the receiver exactly once. This requirement can be achieved by combining the following two enterprise integration patterns:

Guaranteed Delivery

The Guaranteed Delivery pattern guarantees that a message will eventually be delivered to a receiver, even if there are temporary failures in the messaging system. However, because of the possibility of redeliveries, this pattern can result in a message being delivered multiple times.

Idempotent Receiver

The Duplicate Message Suppression pattern addresses the issue of handling duplicate messages and ensures that if a component receives the same message multiple times, it processes it only once.

Read more here: Quality of Service Exactly Once

Summary

This lesson describes various integration patterns, including Aggregator, Composed Message Processor, Content-Based Routing, Content Enricher, Content Filter, Message Filter, Recipient List, Resequencer, Scatter-Gather, Splitter, and Quality of Service Exactly Once.

Install Example Integration Flows

Business Scenario

The enterprise patterns, including aggregator, content enricher, and dynamic routing, among others, have specific technical requirements. To learn and apply these patterns effectively, it is useful to have a collection of best practices, tips, and tricks. SAP offers self-study options, such as a complete implementation as integration flow, a comprehensive description on sap.help, and a Postman Collection for testing the deployed integration flows. You can find all this knowledge in the integration flow Design Guidelines, which we can use to implement selected scenarios.

Task Flow

In this exercise, you will perform the following tasks:

  1. Log on to the DiscoverIntegration view.
  2. Search, find, and copy the example integration flows to your Design area.
  3. Check out the documentation.
  4. Check out the help pages.

Prerequisites

A functional Integration Suite → Cloud Integration with an appropriate user is all that is required.

Outcome After This Exercise

The integration flow guidelines were discovered and reviewed.

What do you Learn Within This Exercise?

To gain knowledge about integration patterns, it is highly recommended to locate and explore the integration flow design guidelines, which serve as an excellent source of information.

Task 1: Log On to the Integration View

Steps

  1. Log on to the DiscoverIntegration view.

    1. Navigate to DiscoverIntegrations.

      Choose Discover > Integrations.

Task 2: Search, Find, and Copy the Example Integration Flows to Your Design Area

Steps

  1. Search for Examples.

    1. In the search bar, enter Examples, and choose the magnifying glass icon to search for examples.

      Enter Examples into the search bar and choose the magnifying glass.
    2. Locate the eight Integration Flow Design Guidelines.

  2. Copy the content of Integration Flow Design Guidelines - Learn the Basics to your Design area.

    1. Select the Integration Flow Design Guidelines link from the search result list.

      Select the Integration Flow Design Guidelines link.
    2. Choose Artifacts (33).

      Choose Artifacts (33).
    3. There are more than 30 integration flows available for exploration. There is also a Documents tab, which we will explore later.

    4. On the top right, choose the Copy button to copy the complete package to your Design area.

      Choose Copy.
    5. Open from the left-side menu DesignIntegrations.

      Choose the package.
    6. Choose the Integration Flow Design Guidelines - Learn the Basics package.

      In this section, you find the Artifacts and Documents tabs.
    7. In this section, you find the Artifacts and Documents tabs.

    8. Choose the Artifacts tab.

    9. First, locate the Generic Receiver and choose it. This artifact is a prerequisite for all other artifacts in this package, so it must be installed first.

      Choose Generic Receiver and then choose Action > Deploy.
    10. Use the ActionDeploy button to deploy the Generic Receiver.

Task 3: Check Out the Documentation

Steps

  1. Check out the Documentation.

    1. Navigate to the Documents tab.

      • No. 1: The Postman Collection (all needed Messages are ready for use out of the box within the HTTP Client Postman).
      • No. 2: Jump to the Help Portal.
      • No. 3: Jump to the installations tutorial for the Integration Flow Design Guidelines.
      Screenshot of the Documents tab showing the options to check out the documentation as previously mentioned.

Task 4: Check Out the Help Pages

Steps

  1. Check out the How to Work with the Example Integration Flows (No. 3).

    1. Choose the How to Work with the Example Integration Flows link (No. 3).

      Screenshot of the SAP Help Portal with the guidance on how to work with example integration flows.
    2. Check out this page. We will do the same in the next task.

  2. Check out Package Documentation on SAP Help Portal (No. 2).

    1. Choose the Package Documentation on SAP Help Portal link and access the documentation of each integration flow.

    2. Go to the left-side menu and navigate to DevelopmentIntegration Flow Design Guidelines.

      Note

      The Integration Flow Design Guidelines cover several topics, including Decouple Processing, Decouple Sender and Flows Using Persistence, and Decouple Sender and Flows Using JMS Message Queues*.

      Choose Decouple Sender and Flows Using JMS Message Queues.
    3. Refer to this page for the upcoming task where we will implement and execute this scenario.

Install the Postman Collection

Business Scenario

The following steps can be followed to try out selected scenarios and study their mode of operation using the appropriate messages sent to the endpoints of the processes via HTTPS. SAP provides a predefined collection of messages for this purpose. It is also possible to use other HTTP clients, such as Insomnia.

Task Flow

In the task of this exercise, you will perform the following steps:

  1. Download the Postman Collection JSON file.
  2. Open the Postman HTTP Client.
  3. Install the Postman Collection.

Prerequisites

  • The process of creating an HTTP Client to send SOAP messages to an integration flow has been completed.
  • You have completed the task Create an HTTP Client to send SOAP messages to an integration flow using Postman. To use Postman, you must have it installed on your machine. Alternatively, you can use Insomnia as an alternative to Postman. If you choose to use Insomnia, you can import the JSON Collection of messages.

Outcome After This Exercise

A well-prepared Postman collection is available for testing all the Integration Flow Design Guidelines.

What do you Learn Within This Exercise?

Acquire knowledge on configuring an OData Adapter for your API (API Business Hub Enterprise) and learn how to use it.

Task 1: Install the Postman Collection

Steps

  1. Download the Postman Collection JSON file.

    1. Navigate to Integration SuiteDesignIntegrations and open the copied package Integration Flow Design Guidelines - Learn the Basics.

      Navigate to Integration Suite. Choose Design > Integrations. Then, open Integration Flow Design Guidelines - Learn the Basics.
    2. Navigate to the Documents tab and choose Modeling Basics - Postman Collection.

      The download of the zipped JSON file ModelingBasics.postman_collection.zip starts.

    3. Unzip this file locally on your computer.

      Navigate to the Documents tab and choose Modeling Basics - Postman Collection.
  2. Open Postman HTTP Client with your workspace.

    1. Open Postman HTTP Client and navigate to your workspace DelayedDelivery_Process.

      Open Postman HTTP Client and navigate to your workspace DelayedDelivery_Process.
  3. Install the Postman Collection.

    1. In your workspace, choose the Import button.

      Choose Import.
    2. At the File tab, choose Choose Files and import the ModelingBasics.postman_collection.json file.

      Choose Files and import the ModelingBasics.postman_collection.json file.
    3. Choose the Import button.

      Choose Import.
    4. You have now imported a new collection within your workspace ModelingBasics.

      Screenshot of the imported new collection.
    5. Now, you have a collection of messages that can be sent to the provided integration flows.

Log in to track your progress & complete quizzes