Introduction:
A quick step by step guide to setup new feature Idempotent Process Call in Cloud Integration (Cloud Foundry Environment).
The Idempotent Process call can be used to achieve Exactly once scenario on Cloud integration using a unique identifier set as message ID.
It detects if a message ID(unique Identifier) has already been successfully processed and stores the status of the successful process in the idempotent repository.
Business Requirement:
We want to achieve exactly once message processing scenario using Idempotent Process call pallete option.
Scenario:
In below use case we are trying to process OrdersStatus from Third-party sender system. We are using the OrderNo coming from the source payload as unique identifier.
So if we try to process the same message(with same Order No) next time message shouldn’t be processed or integration should allow us to handle the scenario in an appropriate manner.
In this case we are checking if the the payload is coming with same order no. If duplication is found we are sending an alert with Order no and updating that we would not be processing the message further. We are using a webhook to demostrate the output of the scneario.
Successfull Process steps [ 1 – 2 – 3 – 4 – 5 – 6 ] : These process steps are executed when the message is received on cloud integration system for the first time.
Duplicate Entry Found Process steps [ 1 – 2 – 3 – 7 – 8 – 9 – 10 ] : These process steps are exectued when the same message is recieved on Cloud Integration for more than once.
Step 1 | Sample message is posted through postman to the source API URL of cloud integration. |
Step 2 |
The property orderID is set using xPath expression to fetch it dynamically. |
Step 3 |
— Pallete option for Idempotent Process Call. we are using orderID as unique identifier which would be stored in idempotent repository for duplicate check. |
Step 4 | Setting Up the processed data. In this case we are just adding an additional line to the payload but in real time we could have multiple steps of processing inside this local integration process. |
Step 5 |
Post processing we are posting the message to a webhook where we captured the output. Instead it could be any system where we want to post the transformed message. |
Step 6 & 7 |
When we try to process the same message more than once the message ID/Unique identifier is comapred with the value in idempotent repository and if it matches the CamelDuplicateMessage flag is set to true. We could use the flag to take appropriate action. It could be an alert or we could send the message to any other system. |
Step 8 | Calling local integration process to take certain action like sending alerts in case of payload not processed because of duplicate entry found. |
Step 9 & 10 |
Conclusion:
So using this scenario we were able to demostrate how to achieve process [Exactly Once] scenario based on a unique identifier and using Idempotent Process call pallete option.
Testing Tools:
References:
[ https://help.sap.com/viewer/368c481cd6954bdfa5d0435479fd4eaf/Cloud/en-US/84c85d753dcd4400a440fb1915899b72.html ]Hope this helps !
thanks and regards,
Praveen T