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!
cancel
Showing results for 
Search instead for 
Did you mean: 
kc_kristris
Active Participant
3,755
SAP CPI provides various ways for message persistence – "Persist" message is one of them. Using this option, developers have control to store a payload at a specific point in the process. Further, this payload can be used as a reference point for any analysis. A simple use case could be – “business process validation” – where business wants some dependent information to meet compliance.
Some facts about Persist step:



  • Shares the same tenant DB as the data store (Details)



  • To access the contents – Use Cloud Integration OData API



  • Message store can be accessed only after execution of the i-flow that writes the entry



  • Life of message is 30 days, after that it will be deleted automatically



 
API Details:



Scenario for understanding the functionality:

  1. Send an HTTP request (ProductID)

  2. Store the request payload using “Persist Message” (Before Message)

  3. Fetch “Product Review” through OData API based on requested ProductID

  4. Store the “Product Review” response payload using “Persist Message” (After Message)



 

Integration Flow Design


Integration Flow Design


 

OData Channel Configuration
Address: https://refapp-espm-ui-cf.cfapps.eu10.hana.ondemand.com/espm-cloud-web/espm.svc

Resource Path: CustomerReviews

Query: $select=Comment,FirstName,LastName,ProductId,Rating,CustomerReviewId,CreationDate&$filter=ProductId eq '${property.Productid}'



OData Channel Configuration


 

HTTP Request - POSTMAN 


Sending ProductId through HTTP Request


 

HTTP Response - POSTMAN 


Receiving Customer Review through HTTP Response


 

Getting Message ID


Message ID


 

Cloud Integration OData Call 
Pass copied Message ID to "MessageProcessingLogs" to fetch "MessageStoreEntries"

https://<Cloud Integration host>/api/v1/MessageProcessingLogs('<Message ID>')/MessageStoreEntries


https://4cb3e2d7trial.it-cpitrial04.cfapps.eu10-002.hana.ondemand.com/api/v1/MessageProcessingLogs('...




Get MessageProcessingLogs based on Message ID


 
Pass copied Id to "MessageStoreEntries" to fetch the payload

https://<Cloud Integration host>/api/v1/MessageStoreEntries('<Message Stored Entries Id>')/$value


https://4cb3e2d7trial.it-cpitrial04.cfapps.eu10-002.hana.ondemand.com:443/api/v1/MessageStoreEntries...




Persist payload from 1st MessageStoreId (ProductBefore)


 

https://4cb3e2d7trial.it-cpitrial04.cfapps.eu10-002.hana.ondemand.com:443/api/v1/MessageStoreEntries...



Persist payload from 2nd MessageStoreId (ReviewAfter)


 
Now, it is your turn to design your business use case by implementing message persistence – through “Persist”; access the stored message content through Cloud Integration OData API & feel the power of API Business Hub. Please do share your use case as well 😊

Any question or feedback will be appreciated!

 
 
3 Comments
Labels in this area