
The need to reduce costs associated with operating and maintaining an active message broker led to the creation of a tool that automates the generation and configuration any time the need for asynchronous event-based messages arises.
This article will showcase a method of creating an event broker in Advanced Event Mesh by leveraging the REST endpoints provided by Solace and SEMP configuration. The solution will allow the system to request a broker creation, monitor the status, re-generate the queues and topics and extract the endpoints for sending or receiving data. Besides that, a UI has been set up that simplifies the broker configuration and allows users to persist or modify configurations.
All the necessary steps for broker creation are done in SAP Integration Suite using multiple iFlow artifacts for each process step, JMS Queues for handling connection errors, timeouts and message routing, Datastore for saving broker configurations and a main page that acts as a user interface for setting up everything.
Picture 1 - Architecture Overview
Picture 2 - UI Configuration Page
The configuration page is a HTML page exposed as a REST endpoint, containing multiple sections that allow the user to generate new configurations, use existing ones and even check the status of the already-deployed broker creation jobs.
Picture 3 - Deployment Page
On this page, we can see the status of the active or pending brokers on the cluster. I also added the ability to delete the broker on demand.
The process of creating an event broker has been detailed in the Managing Services with the SAP Integration Suite, Advanced Event Mesh REST API section and it consists of several REST calls in order to create a broker, get the connection details and check the creation status.
The most important parameters that allow us to continue with the next steps are :
In order to create an event broker :
HTTP POST https://api.solace.cloud/api/v0/services
{
"name": "Broker Name",
"datacenterId": "<Data Center Id>",
"serviceClassId":"developer",
"serviceTypeId": "developer",
"adminState": "start"
}
The authentication for this endpoint is made via an authorization token generated in the Cluster Manager.
Picture 4 - API Token Management
In order to create a queue object :
HTTP POST https://<defaultManagementHostname>/SEMP/v2/config/msgVpns/<msgVpnId>/queues
{
"accessType": "exclusive",
"egressEnabled": true,
"ingressEnabled": true,
"msgVpnName": "<msgVpnId>",
"owner": "all",
"permission": "consume",
"queueName": "<queue-name>"
}
In order to create a topic subscription object :
HTTP POST https://<defaultManagementHostname>/SEMP/v2/config/msgVpns/<msgVpnId>/queues/<queue-name>/subscriptions
{
"msgVpnName": "<msgVpnId>",
"queueName": "<queue-name>",
"subscriptionTopic": "<topic/name>"
}
In order to create a rest delivery point object :
HTTP POST https://<defaultManagementHostname>/SEMP/v2/config/msgVpns/<msgVpnId>/restDeliveryPoints
{
"clientProfileName": "default",
"enabled": true,
"msgVpnName": "<msgVpnNameId>",
"restDeliveryPointName": "<restDeliveryPointId>"
}
If everything is correctly triggered, we should be able to see in the Cluster Manager our newly created broker, and as well in the broker console the queues and topics.
Picture 5 - Cluster Manager
Picture 6 - Queues
Picture 7 - Topics subscribed to a queue
By using the recently published adapter for Advanced Event Mesh integrations, we can insert and consume events from our brokers. Below is a sample iFlow artifact that connects to a specific topic and consumes messages from there.
Picture 8 - iFlow artifact for topic message consumption
Using the SAP Help documentation was the key behind the success, because the product is rather new on the market and we did not really heard of other use cases yet. By following the steps we were able to easily connect two Business Technology Platform products and we were able to leverage event-based integration far more powerful than the traditional SAP Event Mesh.
For any questions or suggestions, feel free to post here or in the special Q&A Section.
Thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
21 | |
18 | |
11 | |
9 | |
7 | |
7 | |
7 | |
6 | |
5 | |
5 |