Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
Showing results for 
Search instead for 
Did you mean: 

Previous – Durable Subscriber | Index | Next – Service Activator

This week, we'll study a pattern known as Idempotent Receiver.

When do I use this pattern?

An Idempotent function is a function that returns itself when applied on itself. In messaging, an Idempotent Receiver will be able to process a duplicate message to result in the same end state of the system as if the message was processed once.

Idempotent Receiver in CPI

In CPI, I'll demonstrate the Idempotent Receiver using an example of customer sync flow. The customer is updated in the master system and all the other systems should get the update.

Integration Flow

Customer Sync

The integration flow starts immediately using Timer Start Event, sets the body to be updated in Salesforce using Content Modifier, sends the request to Salesforce using AdvantCo's Salesforce Adapter.

This payload is set in 'Set Body' content modifier:
<?xml version="1.0" encoding="UTF-8"?>
<Condition>Last_Modified_Date__c &lt;= 2020-09-27T16:53:27.000Z</Condition>

In this example, the Idempotence is achieved using the message itself. The field Last_Modified_Date__c is set to a date and time when the customer was updated in the master system and the WHERE clause or the Condition field checks if the last modified date in the target system is in the past before actually performing the update.

If ECC is master and IDocs are being used to communicate change, then the fields CREDAT (created date) and CRETIM (created time) can be used to populate Last_Modified_Date__c. So, even if the same IDoc is sent twice because ECC did not receive an acknowledgement, the target system does not get updated unnecessarily.

EIPinCPI Rating - N/A

The EIPinCPI rating is not applicable for this pattern because the pattern describes how a receiver could be designed instead of the middleware system.


Idempotent Receiver is useful to prevent out of order or duplicate processing of the messages. In CPI, the Idempotence depends on the message itself and the receiver.

References/Further Readings

Hope this helps,

Previous – Durable Subscriber | Index | Next – Service Activator

Labels in this area