Hi, my name is Denys van Kempen, SAP HANA Academy.
In this video tutorial series we are going to explore the Kyma runtime of the SAP Business
Technology Platform.
This video was recorded in January 2022.
For the latest tutorials on the topic, please check the playlist.
In this video, part two, we are going to continue with SAP S/4HANA Cloud extensions covering
events, messaging, and SAP Event Mesh.
Brief recap: in the previous video, we registered an SAP S/4HANA Cloud system and this triggered
the creation of the SAP S/4HANA Cloud Extensibility service with two plans: api-access and messaging.
We then assigned both plans to a subaccount and this in turn makes it possible to create
a service instance in the Kyma environment, for which we used the Kyma Dashboard.
This works the same for the messaging plan, but now we also need a service instance of
SAP Event Mesh.
Let’s check whether this service has been activated for our global account.
Yes, Event Mesh is available as service, with two plans default and standard (application).
The default plan enables you to setup the infrastructure, create an event bus, the standard
(application) plan provides us with a user interface, a web UI, to configure messaging
clients, queues, and subscription, and we will see both in action.
If nothing is listed here you need to purchase SAP Event Mesh from the SAP Store, and see
the SAP Discovery Center for pricing, you will find the links to the resource in the
technical article, blog post, in the description below.
Okay, step one, assi assign the service to a subaccount.
Entity Assignments, Select Entities
Go
Configure Entitlements, Add Service Plans,
Event Mesh Select the default plan
Add 1 service plan Save
Takes a few seconds,
and here we have the Event Mesh service, deafult plan, listed.
Now we can go to our subaccount and launch the Kyma Dashboard.
We are going to create two service instances: one for Event Mesh and one for SAP S/4HANA
Cloud Extensibility using the messaging plan.
The first provides the infrastructure, as mentioned, the event bus, the second will
create a client to publish events, and we will start with that first.
You can create service instances in the default namespace or add a new namespace.
Service Management, Catalog
Filter on ex Select SAP S/4HANA Cloud Extensibility
Add Note that we are limited to one service instance
per namespace
You can use the suggested name or come up with something even more original, plan is
messaging, and then we also need to enter parameters in JSON format, associated with
the Enterprise Eventing Integration communication scenario (SAP_COM_0092).
We have covered communication scenarios in the previous video when we discussed the api-access
plan of the Extensibility service.
Again, for more information see the blog post mentioned in the description of the video
below.
Here we have the sample code from the documentation.
The required parameters are system name and the event mesh (enterprise messaging) client
identier, emclientid.
The system name needs to correspond to the name used to register the SAP S/4HANA Cloud
tenant, sample in our case.
The EM client ID will be the name used by our SAP S/4HANA Cloud tenant, the client,
to publish events.
We are limited to four characters for the client ID.
Here we have a more complete example, which allows you to overrule some of the default
values.
The service descriptor JSON file is documented in the BTP guide, section SAP S/4HANA Cloud
Extensibility, with a description and some rules and guidelines for each parameter.
Copy paste
Create
Provisioning takes a while, couple of minutes.
As with the api-access plan, a deployment will be created, single pod, and service,
the Istio gateway.
Note that a messaging service is not bindable.
We do not need to bind our application to use the service.
If we then switch to SAP S/4HANA Cloud, Communication Management, Communication
Arrangement, we can see the arrangement listed
Select for the details The properties Channel, Description, Topic
Space, etc.
correspond to those set in the service descriptor JSON file
Next we need to configure event topics for the channel we just created.
Open the app Enterprise Event Enablement
Select the channel we just created.
Use search if needed.
Here we can create subscriptions, and outbound and inbound topics.
In this case we are interested in an outbound topic
select the topic
and click create.
Next, return to the Kyma Dashboard, Sample namepace.
Service Management, Catalog
Filter on event Select Event Mesh
Add Again, limited to one service instance per
namespace
No need to select the plan, only the default plan will be listed here.
Provide the service descriptor in JSON format
We need to provide the name for the event bus, the namespace, and the queue and topic
rules, which need to correspond with the client configuration
Copy paste
Create
Status first is provisioning and, eventually, running (this will take some time).
No pods or deployments are added.
The ones displayer are from the SAP S/4HANA Cloud Extensiblity service instance.
Back to the BTP Cockpit
Global
Entity Assignment
Select subaccount
Go
Event Mesh
So far, we have only covered the default plan, to create the event bus, and configure the
infrastructure.
Now we are going to add the web interface, the application.
We have already done this a few times, so fast forward a bit
We could also have done this when we added the default plan, of course.
This is just to show what each plan corresponds to.
Havigate to the subaccount Note that Cloud Foundry is not enabled, this
is not required.
Service Marketplace
Event Mesh
Create
Standard (subscription)
Creation in progress, takes a little while, so while this runs, let’s grant ourselves
access
Security Role Collections
Note that four role collections have been added: Enterprise Messaging Administrator,
Developer, Disolay, and Subscription Administrator, for privileged users only.
User with care.
Add your account as Administrator
and
Subscription Administrator.
Go back to instances and subscriptions
and now we should be able to access the Event Mesh application.
Open the message client created when creating the Event Mesh service instance.
Messaging is enabled
Rules
Queues
Create queue
Give the queue a name
You can fine tune the queue configuration.
Create
Open Queue Subscription
and as topic
first add the namespace
plus the outbound topic created in SAP S/4HANA Cloud.
Add
Close
That’s it.
We are all setup for event-based SAP S/4HANA Cloud extensions running in the Kyma envrionment.
All you need to do is create a function or microservice and bind the application to the
Extensibility service.
You can always add or change the outbound topics of the channel using the SAP S/4HANA
Cloud Enterprise Event Enablement app and should you want to change the namepapce or
other configuration items of the EM clients, simply delete and recreate the service instance
using the Kyma Dashboard.
This video tutorial was recorded by Denys van Kempen, SAP HANA Academy.
Any good?
Give us a like, and for updates, don’t forget to subscribe.
Thanks for watching.