Company

About Us
Team
Careers
Customer
Customers
Partners
Partners
Partners

Inchara - CSR

Partners

Contact Us

Latest News

Cherrywork Digital Applications

Overview

Portfolio

Industry 4.0

Intelligent Procurement

Customer Experience (CX)

Human Experience Management (HXM)

Products

Account Payable Automation Image
Accounts Payable Automation
Account Payable Automation Image
Smart Warehouse
Task Management Image
Intelligent Work Management
Intelligent Price Management Image
Intelligent Price Management

Accelerators

Blue Collaborative Order Management Image

Collaborative Order Management

Company Images

Resource Management

Shopping Cart

In-Store Perishables Management

Shopping Cart

Permit to Work (P2W)

Shopping Cart

Proof of Delivery (POD)

Blue Collaborative Order Management Image

Predictive Asset Maintenance

Blue Collaborative Order Management Image

Supplier Collaboration Portal

Blue Collaborative Order Management Image

Advanced Metering Analytics

Blue Collaborative Order Management Image

Pipeline Corrosion and Leak Detection

Digital Transformation Services

Overview

Data & AI

Intelligent Process Automation

Robotic Process Automation
Mobility & UX
Robotic Process Automation
Cloud Platform & Solutions
Robotic Process Automation
Sustainability Management

SAP Core Services

Industries

Consumer Products & Retail
Drive Intelligent Value with Digital

Manufacturing
Digitize E2E Value Chain

Oil and Gas
Extend Beyond the Barrel with Digital

Life Sciences
Improve Patient Outcomes and Safety

Resources
Events
Blogs

Case Studies

Press Room
Newsletter
SAP Innovation Pitch Decks

Cherrywork.com

Guide: Step By Step Procedure To Send And Receive Messages in a SAP Event Mesh Instance | SAP Blogs

WRITTEN BY

Ramya P
PUBLISHED​
26th May 2022
INTEGRATION
SHARE
Hello everyone!

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

SAP Event Mesh is a dynamic service that helps applications, services, and systems interact with each other through messages and events.

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:

Event Mesh Instance- Detailed steps are provided here

Procedure to Send Messages to the Queue

STEP -1 : Setting up POSTMAN
  • Open the POSTMAN application or on a browser, and create a new request.
SAP event mesh Instance
STEP -2 : Authorization Configurations

Click on the Authorization tab in Postman and click on the drop-down menu from Type and choose OAuth 2.0.

SAP event mesh Instance
Provide a user-friendly Token Name and choose the Grant Type as Client Credentials and get the Access Token URL from the Event Mesh Instance Service Key.
Coding
STEP- 3: Header Configuration

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

STEP- 4: URL Configuration

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

Here ‘test’ is the queue name.
STEP- 5 : Sending Message

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.

enterprise messaging pubsub
Sending a message to event mesh using POSTMAN
STEP- 6 : Verifying in the SAP Event Mesh- Messaging Administration
Test
Queue gets updated

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//messages/consumption

The final link should look like this:
https://enterprise-messaging-pubsub.cfapps.us10.hana.ondemand.com/messagingrest/v1/queues/test/messages/consumption
Here ‘test’ is the queue name.

On hitting the send button you should be able to see the messages you previously sent and the status code being 200 OK.

Post
Conclusion

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.

Further Reading
Related Stories