Skip to Content

Handling Bulk Messages

0 %
Handling Bulk Messages

Handling Bulk Messages

Learn how to handle messages individually, when receiving multiple messages as a part of one big message.

You will learn

  • How to split a message containing multiple messages into individual messages
  • How mapping works with bulk messages
QR code

Assume that a customer orders multiple items. The input XML will then contain all the item information. In this exercise, we shall separate the items and process them individually.

Step 1: Process a bulk message
  1. Let us change our input message and add 2 more items to it.

    • Add the following text to your input message:


    Once done, your message should look like:

    New Input
  2. Execute your flow with the new message. You will see that the output mail only contains 1 item information:

    Bulk items ignored
  3. This is because the cardinality of the Item field is set to 1..1.

    Incorrect Cardinality
  4. Edit the XSD.

    • Go to the Item field and add minOccurs="1" maxOccurs="unbounded" to it as attributes as follows:

    Change Cardinality
    • Go to the integration flow’s Resources View and delete both Order.xsd and WarehouseOrder.xsd.
    Delete XSDs
    • Go to the Message Mapping and reimport the edited XSD.
    Add New XSD

    In spite of having deleted the XSD, SAP Cloud Platform Integration preserves the maps.

    • Check if all the maps are configured.

    • Save, deploy and execute your flow. You should get one composite mail containing all product information:

    Combined Mail
Log on to answer question
Step 2: Split message
  1. Add a Splitter step to the integration flow:
    • Click on the design Palette.
    • Choose Message Routing.
    • Go to Splitter.
    • Choose General Splitter.
    Choose General Splitter
    • Drag it on to the execution pipeline between the Router and XML to JSON Converter step on the branch for KWA2MNWC2U.
      Name it Split Orders.
    Add General Splitter
    • Configure the General Splitter as follows:
    Field Value
    Expression Type XPATH
    XPath Expression /orders/order/items/item
    Grouping 1
    Streaming Checked
    Parallel Processing Unchecked
    Stop on Exception Checked
    • Save, deploy and execute your flow. You should get one 3 individual mails containing individual product information:
    Separate Mail

    Play around with the different types of splitters and different configuration, to understand how the results differ.

What do you need to change to make sure message mapping consider multiple occurrences of an element in SAP Cloud Platform Integration?

Next Steps

Back to top