Technical Articles
Use CPI AMQP adapter to test BTP Event Mesh
In the situation of extesionsibility options determination like the following picture, to keep core system clean,for loose coupled application extension, we recommand to use side-by-side extensibility on BTP. In decoupled application, BTP Event Mesh play an important role. We can realize some requirements with Integration instead of side by side extention.Today I will demo how use CPI AMQP adapter to test BTP event mesh.In my following blogs, I will introduce how to use CPI to realize some logic triggered by S/4 Hana Cloud event .
Prerequisite:
-
You have finished your Initial Setup for you SAP Integration Suite .You will have CPI runtime service key information as the following:
-
For Event Mesh, you have finished the following 3 steps:
- Get Started with the Event Mesh User Interface
- Setting Up SAP Event Mesh in BTP Cockpit
- Creating an Event Mesh Instance Using the Default Plan,you will event mesh instance service key like the following:
Testing Steps:
1, Create Event queue as help .
2 Create oauth2 client credential in CPI
3 Create and deploy iflow in CPI to consume event from event queqe in Event Mesh
/* Refer the link below to learn more about the use cases of script.
https://help.sap.com/viewer/368c481cd6954bdfa5d0435479fd4eaf/Cloud/en-US/148851bf8192412cba1f9d2c17f4bd25.html
If you want to know more about the SCRIPT APIs, refer the link below
https://help.sap.com/doc/a56f52e1a58e4e2bac7f7adbf45b2e26/Cloud/en-US/index.html */
import com.sap.gateway.ip.core.customdev.util.Message;
import java.util.HashMap;
def Message processData(Message message) {
//Body
def body = message.getBody(java.lang.String);
def messageLog = messageLogFactory.getMessageLog(message)
if (messageLog != null) {
messageLog.addAttachmentAsString('Em content', body, 'text/plain')
}
return message;
}
4 Create and deploy iflow in CPI to produce event to event queqe in Event Mesh
5 Use postmen to send message to eventissue iflow in step4
6 Check result in iflow of event consuption
The End!
Thanks for your time!
Best Regards!
Jacky Liu
Be the first to leave a comment
You must be Logged on to comment or reply to a post.