SAP Manufacturing Integration and Intelligence (SAP MII) is used to improve your manufacturing processes. SAP PRESS has recently published the book Implementing SAP MII co-authored by Dipankar Saha (Principal Architect – Incture Technologies).
WRITTEN BY
In the recent past, I have been exploring so many SAP BTP capabilities as part of my work and out of interest.
This is my first blog post on the enterprise-messaging capability of SAP. This service allows components to communicate through asynchronous events and distributes business events from SAP and non-SAP sources across hybrid landscapes.
Introduction
Solving the issue of scalability, SAP Event Mesh enables the reliable exchange of messages between sender and receivers.
The message broker works like a charm! We have the sender application, a message broker, and a receiver application, which could be one or many. Asynchronous communication takes place between the application, services, or systems wherein the sender application isn’t bogged down by waiting for a response from the receiver and the Reciever(s) can subscribe to critical business needs and can consume the messages on their own pace.
In this blog post, I would be detailing the step-by-step procedure to send messages to the queue and consume them as well using the REST API tool POSTMAN.
Please note that a detailed tutorial already exists, and this blog post is an improvisation of that.
Pre-Requisite:
Procedure to Send Messages to the Queue
Click on the Authorization tab in Postman and click on the drop-down menu from Type and choose OAuth 2.0.
In the header of your postman add x-qos in the key and a value of either 0 or 1 in the VALUE section
QOS means Quality of Service.
It denotes the way the messaging protocol handles retransmission of the message and ensures its delivery regardless of network reliability.
If the QoS is 0, the service tries to deliver the message and returns an HTTP response with code 204 irrespective of whether the message is delivered, also the message is deleted from the queue without an acknowledgment from the client.
If the QoS is 1 delivery of the message is guaranteed, and the service responds with the HTTP response code 204. If the 204 response code isn’t received, it’s the client’s responsibility to retry until the response code 204 is received.  The message is deleted from the queue only after the acknowledgment is consumed
Build the postman URL as shown below:
https://<uri of the rest protocol based section from Service Keys>/messagingrest/v1/queues/<Queue name>/messages. It is the uri at the end of the document.
So your final link should look like this:
https://enterprise-messaging-pubsub.cfapps.us10.hana.ondemand.com/messagingrest/v1/queues/test/messages
Type a message and click on send if the status is 204 No Content, which means, the message has been sent successfully.
You can check the same in the event mesh instance page you previously created.
Procedure to Send Messages to the Queue
The first two steps remain the same.
For consuming the messages we previously sent, all we have to do is change the URL.
Build the postman URL as shown below:
https://< uri of the rest protocol based section from ServiceKeys>/messagingrest/v1/queues/
On hitting the send button you should be able to see the messages you previously sent and the status code being 200 OK.
This blog post provides a detailed step-by-step procedure for you to update a queue in the event mesh using the REST API tool POSTMAN and also the procedure to consume those messages.
In the upcoming blog post, I will be writing about using the AMQP adapter to send messages to a topic and consume the message from queues via email and an open connector.
SAP Manufacturing Integration and Intelligence (SAP MII) is used to improve your manufacturing processes. SAP PRESS has recently published the book Implementing SAP MII co-authored by Dipankar Saha (Principal Architect – Incture Technologies).
This is my first blog Post where I have been tried to describe a real time scenario of CPI where we have to call the iflow followed by another iflow and spilt the data and fetch it with looping process call.