[[{“value”:”
To bring Event APIs from SAP Integration Suite, advanced event mesh into the familiar API developer experience of SAP Developer Hub, Advanced Event Mesh first needs to be enabled for API Management.
This blog is Part 1 of a four-part series, covering the journey from setting up Advanced Event Mesh to consuming Event APIs through Developer Hub:
- Part 1: Enabling Advanced Event Mesh for API Management
- Part 2: Connecting Advanced Event Mesh and Developer Hub
- Part 3: Publishing event APIs on Developer Hub and managing API Products
- Part 4: Discover and consume Event APIs from SAP Developer Hub
In this first part, we’ll focus on the required setup to enable Advanced Event Mesh for API Management and prepare the environment for the next steps.
Note that in the example we only use 1 broker, if you are using multiple brokers you need to repeat the steps for these brokers as well.
Prerequisites
Before going through this tutorial, we strongly recommend you already have created:
- a Service in the Cluster Manager
- a Modeled Event Mesh in the Runtime Event Manager (containing at least 1 Broker)
The roles required in SAP AEM for this tutorial are:
- Mission Control Manager
- Event Portal Administrator
On your workstation:
- Terraform CLI Client
ℹ️ Don’t worry, you don’t need any prior Terraform experience.
That said, some Terraform knowledge can come in handy when troubleshooting.
Enable Event Broker connections on your event mesh
First, we need to get the endpoint of the broker where you want to enable API connectivity. This is what we’ll use in the Runtime Event Manager to enable the connectivity itself.
- In the Cloud Console of SAP Integration Suite, advanced event mesh, go to “Cluster Manager“
- Go to the the Event Broker where you want to enable API connectivity.
- Press “Connect“, select a Client Library such as “REST”, and copy the host
⚠️Note: you don’t need to copy the protocol (e.g. https) or the port (e.g. 9443), what you copied should be in the following format: ########.messaging.solace.cloud or 123.89.40.72 - Once you copied the host, go to “Runtime Event Manager” to enable the connectivity.
- Select the modeled event mesh where you want to enable the API connectivity
- Click on “Event Broker Connections“, select the Event Broker where you want to enable API connectivity and press “View Connection Details“
- Paste the host under “Host“.
⚠️make sure you don’t have the protocol or port in here! - Add the protocols you need (e.g. REST, SMF, AMQP) by clicking on “Add Protocols”.
You can change transport (e.g. https instead of http) and port settings once you selected your preferred protocol(s).
For this tutorial I kept the default settings as-is, I just enabled secure transport. The authentication should remain “Basic Authentication”.
Add predefined client profiles to your Event Broker
Before an Event API Product can be used on an event broker, API Management expects a specific set of six client profiles to already exist on that broker. When an application is approved against a plan, APIM assigns it a client username and picks one of these profiles based on what the plan allows. If the profiles aren’t there, that assignment has nothing to point at and application will not work properly.
The six cover the combinations of guaranteed messaging permissions a plan can grant:
| Client Profile | Guaranteed Messaging |
| APIM-NoGM | none – direct messaging only |
| APIM-ReceiveOnlyGM | receive |
| APIM-SendOnlyGM | send |
| APIM-ReceiveSendGM | send + receive |
| APIM-ReceiveCreateEndpGM | receive + create endpoints |
| APIM-ReceiveSendCreateEndpGM | send + receive + create endpoints |
You could click all six into Broker Manager by hand. But Advanced Event Mesh can be managed via SEMP APIs/Terraform, so let’s discover that. There is a Terraform project published on Github that creates the client profiles declaratively, that’s what we’ll use here. It takes about ten minutes from a standing start, including installing Terraform. More information can be found in the documentation.
- Go back to the Event Broker where you want to enable API connectivity (under to “Cluster Manager“).
- Go to “Connect“, go to the bottom and press “SEMP – REST API“.
- Under “SEMP Credentials“, select “Mission Control Manager” (also works with other users as long as it is an admin user), copy the following details and paste it into a notepad:
- SEMP Public Endpoint (e.g. https://mr-connection-xxxxxx.messaging.solace.cloud:943)
- Message VPN
- Username (in this example: mission-control-manager)
- Password
- Now, let’s use Terraform!
Open your terminal and to install Homebrew and Terraform, using the following commands one by one (optional, skip if you already have Terraform)
brew tap hashicorp/tap
brew install hashicorp/tap/terraform
terraform -version
Note: if a Terraform version appears after executing “terraform -version” (e.g. Terraform v1.16.1) the installation of Terraform was successful
- Use the command line to navigate to the folder where you want to keep the Terraform project (command: cd), and clone the following Git Repository.
git clone https://github.com/solace-cto-labs/terraform-solacebroker-apim-clientprofiles.git
cd terraform-solacebroker-apim-clientprofiles
The project contains 3 files: “providers.tf” names the provider plugin, “variables.tf” contains the inputs, and “main.tf” declares the six client profiles. If you have a look at these files, it is very readable even if you’ve never seen Terraform.
- Create a file and name the file “terraform.tfvars“, this will contain the values of the variables. This should contain the following:
url = “https://mr-connection-xxxx.messaging.solace.cloud:943”
msg_vpn_name = “my-service-vpn”
username = “mgmt-user”
⚠️Don’t forget to replace the variables in the file with your own url, VPN name and username copied from step 3.
- Now, go back to the terminal (in folder “terraform-solacebroker-apim-clientprofiles”). In the previous step, we didn’t put the password in the file, this we did on purpose. Pass the password as an environment variable using the following command:
export TF_VAR_password=’your-management-password’
- Let’s download the provider plugind:
terraform init
- Execute the following command, this reads your broker over SEMP, compares it to the configuration, and prints what it would do without changing anything:
terraform plan
- When everything worked fine so far, you can execute the terraform apply command.
terraform apply
-
It shows the plan again and waits. Type “yes” in full.
-
You should now see that the terraform was applied, for example:
Apply complete! Resources: 6 added, 0 changed, 0 destroyed. - You can verify in the cloud console whether the profiles have been added, go to Cluster Manager ➡️ select your Broker ➡️ click on “Open Broker Manager” on the right top.
- Now, go to Access Control ➡️ Client Profiles. You should see the 6 new profiles being listed here.
What’s next
If you were able to enable the connectivity on your event broker in the Runtime Event Manager and you have added the 6 client profiles: congratulations you have finished part 1 of this blog series and prepared Advanced Event Mesh for integration with API Management.
With this foundation in place, we can now move on to
Part 2: Connecting Advanced Event Mesh and Developer Hub.
“}]]
[[{“value”:”To bring Event APIs from SAP Integration Suite, advanced event mesh into the familiar API developer experience of SAP Developer Hub, Advanced Event Mesh first needs to be enabled for API Management.This blog is Part 1 of a four-part series, covering the journey from setting up Advanced Event Mesh to consuming Event APIs through Developer Hub:Part 1: Enabling Advanced Event Mesh for API ManagementPart 2: Connecting Advanced Event Mesh and Developer HubPart 3: Publishing event APIs on Developer Hub and managing API ProductsPart 4: Discover and consume Event APIs from SAP Developer HubIn this first part, we’ll focus on the required setup to enable Advanced Event Mesh for API Management and prepare the environment for the next steps.Note that in the example we only use 1 broker, if you are using multiple brokers you need to repeat the steps for these brokers as well.PrerequisitesBefore going through this tutorial, we strongly recommend you already have created:a Service in the Cluster Manager a Modeled Event Mesh in the Runtime Event Manager (containing at least 1 Broker)The roles required in SAP AEM for this tutorial are:Mission Control ManagerEvent Portal Administrator On your workstation:Terraform CLI Client ℹ️ Don’t worry, you don’t need any prior Terraform experience.That said, some Terraform knowledge can come in handy when troubleshooting. Enable Event Broker connections on your event meshFirst, we need to get the endpoint of the broker where you want to enable API connectivity. This is what we’ll use in the Runtime Event Manager to enable the connectivity itself.In the Cloud Console of SAP Integration Suite, advanced event mesh, go to “Cluster Manager” Go to the the Event Broker where you want to enable API connectivity. Press “Connect”, select a Client Library such as “REST”, and copy the host⚠️Note: you don’t need to copy the protocol (e.g. https) or the port (e.g. 9443), what you copied should be in the following format: ########.messaging.solace.cloud or 123.89.40.72Once you copied the host, go to “Runtime Event Manager” to enable the connectivity. Select the modeled event mesh where you want to enable the API connectivity Click on “Event Broker Connections”, select the Event Broker where you want to enable API connectivity and press “View Connection Details” Paste the host under “Host”.⚠️make sure you don’t have the protocol or port in here!Add the protocols you need (e.g. REST, SMF, AMQP) by clicking on “Add Protocols”.You can change transport (e.g. https instead of http) and port settings once you selected your preferred protocol(s).For this tutorial I kept the default settings as-is, I just enabled secure transport. The authentication should remain “Basic Authentication”. Add predefined client profiles to your Event BrokerBefore an Event API Product can be used on an event broker, API Management expects a specific set of six client profiles to already exist on that broker. When an application is approved against a plan, APIM assigns it a client username and picks one of these profiles based on what the plan allows. If the profiles aren’t there, that assignment has nothing to point at and application will not work properly.The six cover the combinations of guaranteed messaging permissions a plan can grant:Client ProfileGuaranteed MessagingAPIM-NoGMnone – direct messaging onlyAPIM-ReceiveOnlyGMreceiveAPIM-SendOnlyGMsendAPIM-ReceiveSendGMsend + receiveAPIM-ReceiveCreateEndpGMreceive + create endpointsAPIM-ReceiveSendCreateEndpGMsend + receive + create endpointsYou could click all six into Broker Manager by hand. But Advanced Event Mesh can be managed via SEMP APIs/Terraform, so let’s discover that. There is a Terraform project published on Github that creates the client profiles declaratively, that’s what we’ll use here. It takes about ten minutes from a standing start, including installing Terraform. More information can be found in the documentation.Go back to the Event Broker where you want to enable API connectivity (under to “Cluster Manager”).Go to “Connect”, go to the bottom and press “SEMP – REST API”.Under “SEMP Credentials”, select “Mission Control Manager” (also works with other users as long as it is an admin user), copy the following details and paste it into a notepad:SEMP Public Endpoint (e.g. https://mr-connection-xxxxxx.messaging.solace.cloud:943)Message VPNUsername (in this example: mission-control-manager)Password Now, let’s use Terraform!Open your terminal and to install Homebrew and Terraform, using the following commands one by one (optional, skip if you already have Terraform)brew tap hashicorp/tap
brew install hashicorp/tap/terraform
terraform -versionNote: if a Terraform version appears after executing “terraform -version” (e.g. Terraform v1.16.1) the installation of Terraform was successfulUse the command line to navigate to the folder where you want to keep the Terraform project (command: cd), and clone the following Git Repository.git clone https://github.com/solace-cto-labs/terraform-solacebroker-apim-clientprofiles.git
cd terraform-solacebroker-apim-clientprofilesThe project contains 3 files: “providers.tf” names the provider plugin, “variables.tf” contains the inputs, and “main.tf” declares the six client profiles. If you have a look at these files, it is very readable even if you’ve never seen Terraform.Create a file and name the file “terraform.tfvars”, this will contain the values of the variables. This should contain the following:url = “https://mr-connection-xxxx.messaging.solace.cloud:943”
msg_vpn_name = “my-service-vpn”
username = “mgmt-user”⚠️Don’t forget to replace the variables in the file with your own url, VPN name and username copied from step 3.Now, go back to the terminal (in folder “terraform-solacebroker-apim-clientprofiles”). In the previous step, we didn’t put the password in the file, this we did on purpose. Pass the password as an environment variable using the following command:export TF_VAR_password=’your-management-password’Let’s download the provider plugind:terraform initExecute the following command, this reads your broker over SEMP, compares it to the configuration, and prints what it would do without changing anything:terraform planWhen everything worked fine so far, you can execute the terraform apply command.terraform applyIt shows the plan again and waits. Type “yes” in full.You should now see that the terraform was applied, for example:Apply complete! Resources: 6 added, 0 changed, 0 destroyed. You can verify in the cloud console whether the profiles have been added, go to Cluster Manager ➡️ select your Broker ➡️ click on “Open Broker Manager” on the right top. Now, go to Access Control ➡️ Client Profiles. You should see the 6 new profiles being listed here. What’s nextIf you were able to enable the connectivity on your event broker in the Runtime Event Manager and you have added the 6 client profiles: congratulations you have finished part 1 of this blog series and prepared Advanced Event Mesh for integration with API Management.With this foundation in place, we can now move on toPart 2: Connecting Advanced Event Mesh and Developer Hub. “}]] Read More Technology Blog Posts by SAP articles
#SAPCHANNEL