With Getting Started with SAP Event Mesh you would have got a feel of SAP Event Mesh. One of the features, that makes SAP Event Mesh completely different than any other Message Broker in the market, is its ability to enable event-driven applications.
An Event can be defined as a significant change in state.
Event-Driven architecture, a software architecture pattern that promotes the production, detection, consumption of and reaction to events.
Monolithic applications have challenges like scalability, reliability and availability and agility. And most probably the root cause of such challenge is high cohesiveness and high coupling of its components. With Micro-services, flexibility comes with the capability of scaling only the needed components and not the application as a whole. Micro-services with Event-Driven Architecture to a great extend solves these challenges and allows building applications capable of dynamic and ever-changing capabilities because of the loosely-coupled architectures where the micro-services are designed to notify each other of changes using events.
And to be able to build such an Intelligent Enterprise, SAP Event Mesh is supposed to play a major role by helping the event notification between micro-services or two different heterogeneous systems.
SAP Event Mesh does support Event-Driven programming model. It has the capability to
Building on this thought process, SAP Event Bus has a feature of out-of-box event enablement from S/4HANA or SFSF business objects.
This blog is dedicated to help the developers build an application which requires event handling from S/4HANA.
To be able to consume events from an Event Source, a developer needs to follow the following steps. 1. Create SAP Event Mesh Instance (including OAuth2.0 Client ID and Secret) to be used by Eventing 2. Create S/4 Communication System and Communication Arrangement 3. Maintain Event Topics for a Channel 4. Queue Subscription to the Event Topic Pattern |
Assumption:
Once we have the SAP Event Mesh Instance available, we need to complete following configurations to enable out-of-box Eventing support from S/4HANA using SAP Event Mesh.
Make the SAP Event Mesh Instance ready for Eventing |
Step 1:
Select the newly created SAP Event Mesh instance,
Step 2:
Step 3:
Step 4:
The newly created Service Key contains following information:
Note: SAP Event Mesh provides several endpoints supporting different protocols (e.g. AMQP1.0 and MQTT 3.1.1 over WebSocket and REST).
Configuring Communication System and Communication arrangement on S/4HANA system |
Step 5:
Logon to S/4 System with an Administrator user:
Navigate to Communication Management area.
Step 6:
General overview of the necessary steps described in this guide:
Step 7:
Select the Communication Systems tile and click on New.
Provide any unique System ID and System Name and click Create.
Step 8:
The newly created Communication System is being displayed. Scroll down to the Technical Data section and provide the General configuration settings:
Under OAuth 2.0 Settings provide:
Step 9:
In the section User for Inbound Communication click the Add button.
The Inbound Communication user is needed to access the S/4 system from the outside.
Step 10:
If you already have an Inbound Communication User available, you can re-use the same.
Otherwise create a new user by clicking on New User.
Step 11:
Step 12:
The newly created Inbound Communication User is automatically selected in the dialog.
Click OK to assign this user.
Step 13:
In the section User for Outbound Communication click the Add button.
The Outbound Communication User is required to connect from the S/4 system to the SAP Event Mesh on CF. The required credentials have been generated when creating the Service Key on CF.
Step 14:
Step 15:
Let us set up the Communication Arrangement.
In Home screen select the Communications Arrangements tile
to create a new Communication Arrangement. Click the New button and provide the following data:
Step 16:
Under Common Data select previously created Communication System from the value help → Inbound Communication, Inbound Services and Outbound Services get filled automatically.
Step 17:
Fill in the Additional Properties:
<topic space>/<event path>
Step 18:
Finally, the details for the Outbound Services need to be provided:
As Path provide: /protocols/mqtt311ws
Click Check Connection
Save the Communication Arrangement.
The Check Connection will try to check if a connection(by creating web-socket) can be established between S/4 and SAP Business Technology Platform.
Step 19:
In the Inbound Services section you can find the URL to call the Event Browser Service.
Maintain Event Topics for a Channel |
Step 20:
Logon to S/4 Backend system with a user that has access to
Implementation Cockpit → Manage Your Solution
Click on Manage Your Solution
Step 21:
Step 22:
Click on Configure for the entry called Maintain Event Topics
Step 23:
Click the value help to choose your Event Channel from the list of
available channels.
Confirm your selection by clicking the green check mark.
Step 24:
Setup Queue Subscription to consume Event Topics to be exposed by this channel. |
Step 25:
Based on the configuration done in the S/4HANA system, the queue contains the messages with the topic name and pattern.
And we are done !!!!.
Yes, the setup steps are done. And we are ready for the consumption.
Now just subscribe your application to the queue, and you are ready to get notified (either in AMQP or in REST protocol) when a message comes to the queue.
A Picture is like thousand words. And let me finish this blog, with the below picture which highlights the E2E story of out-of-box event handling support of SAP Event Mesh with S/4HANA.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
26 | |
20 | |
19 | |
12 | |
10 | |
9 | |
9 | |
8 | |
7 | |
7 |