This is the continuation of my previous blog, where I started with the concepts of event driven architecture and integrated event mesh with CAP project. In this blog I continue the journey by creating a consumer API and integrating an end to end use case starting from CAP project (REST API) - SAP Event Mesh - SAP Integration suite (REST API) - TWILIO
Let us break down the tasks which we are going to perform.
Design thinking and a quick recap of Part-1
Create a consumer application using SAP Integration Suite
Configure SAP Integration Suite REST API as Web hook in Event Mesh
Test the complete flow: CAP (REST API) - SAP Event Mesh - SAP Integration Suite (REST API) - TWILIO
Sounds cool right? Lets start the journey.
Task-1: Design thinking and a Quick Recap of Part-1
Publish message from CAP application to Event Mesh.
In this blog (Part-2), we will create a REST API using SAP Integration suite and configure it as a consumer for consuming the messages from Event Mesh. A quick recap can be elaborated with the help of below diagram -
We are going to focus on Part-B and Part-C.
Task-2: Create a Consumer API using SAP Integration Suite
The goal of this task is to
Set up SAP Integration Suite
Create REST API
Integrate with TWILIO leveraging open connectors
All the above tasks are very well documented in my blog - here
I recommend you to go through the blog. Feel free to like, share and comment to improve it further.
Task-3: Configure SAP Integration Suite REST API as a web hook in Event Mesh
In this task, we are going to set up a consumer API as a web hook in SAP Event Mesh.
Let's get started.
Open the event mesh portal and go the message client.
Go to the web hook tab as shown in the below screenshot
Click - Create Webhook
Set up the properties as mentioned below
Subscription Name - A name for your web hook
Queue Name - The queue for which you are creating the web hook and configuring it as a consumer
Exempt Handshake - Select as YES.
Web hook URL - The REST API url for SAP Integration Suite
Default Content-Type - application/json
Authentication - OAuth2ClientCredentials
Client ID - Client ID for SAP Integration Suite. This you will get it from the SAP Integration Suite Service Key.
Client Secret - Client secret for SAP Integration Suite. This you will get it from the SAP Integration Suite Service Key.
Token URL - OAuth token url for SAP Integration Suite. This you will get it from the SAP Integration Suite Service Key.
Once done, you should see the Subscription Status as ACTIVE.
All set. You have successfully completed this task.
Task-4: Test the complete flow: CAP - SAP Event Mesh - SAP Integration Suite - TWILIO
In this section,
We will send a message to the CAP microservice API for new user creation.
The CAP event handler will compile a welcome message and push it to event mesh topic.
The event mesh topic will push the message to the queue through queue subscription.
The message will be then consumed by the SAP Integration Suite REST API through the web hook.
If all goes well, you should receive a text message on your phone from TWILIO.
Let us see all that in action using POSTMAN.
Open the POSTMAN collection which you might have created as per the guidelines in the task-5 of my previous blog
Sample request to create a new user with role Admin