## 5.6.2.3.3.4  Create Queues and Subscribe to Them
## Prerequisites
Уou have created the SAP S/4HANA Cloud Extensibility service instance in the Cloud Foundry or Kyma environment. See:
- Create an SAP S/4HANA Extensibility Service Instance in the Cloud Foundry Environment [page 2141]
- Create an SAP S/4HANA Cloud Extensibility Service Instance in the Kyma Environment [page 2143]
Уou have created the SAP Event Mesh service instance in the Cloud Foundry or Kyma environment. See:
- Create an SAP Event Mesh Service Instance in the Cloud Foundry Environment [page 2155]
- Create an SAP Event Mesh Service Instance in the Kyma Environment [page 2156]
## Context
After both instances are created and configured, you can create the topic-to-queue subscription. To do so, you first create a subscription to SAP Event Mesh with plan standard . Then, create a queue in the client that refers to the SAP Event Mesh service instance and then subscribe the topic of the namespace of the SAP S/4HANA Cloud Extensibility service to that queue.
##  Note
You can subscribe to the SAP Event Mesh service once per subaccount.
## Procedure
1. Create a subscription to SAP Event Mesh.
- a. In the SAP BTP cockpit, navigate to the space in which you want to create a service instance.
- b. In the navigation area, choose Services Service Marketplace , and then choose Event Mesh in the Service Marketplace panel.
- c. From the Event Mesh service tile, choose Create and follow the steps in the wizard to subscribe to the service.
- d. In the New Instance or Subscription wizard:
1. In the Service dropdown list, select Event Mesh .
2. In the Plan dropdown list, select the standard service plan. Choose Create .
2. Assign the necessary roles to your user.
- a. In the SAP BTP cockpit, navigate to your subaccount.
- b. In the navigation area, choose Security Trust Configuration , and then choose SAP ID Service in the Trust Configuration panel.
- c. On the Role Collection Assignment page, enter the e-mail of your user in the empty field and choose Show Assignments . Then, choose Assign Role Collection .
- d. In the Assign Role Collection wizard, select the following role collections:
- Enterprise Messaging Administrator
- Enterprise Messaging Developer
- Enterprise Messaging Display
- Enterprise Messaging Subscription Administrator
- e. Choose Assign Role Collection .
3. Open the SAP Event Mesh application.
- a. In the SAP BTP cockpit, navigate to the space in which you want to create a service instance.
- b. In the navigation area, choose Services Instances and Subscriptions .
- c. In the Subscriptions tab, choose the Event Mesh application.
- d. From the Event Mesh page, choose Go to Application and open the SAP Event Mesh application.
##  Note
If you are using the sample JSON files when creating the SAP S/4HANA Extensibility and the Event Mesh service instances, you should see 2 message clients in the SAP Event Mesh application, s4hc and ems-s4hc .
4. Create a queue that is specific to your application.
- a. Open the message client created when creating the Event Mesh service instance. For example, choose the ems-s4hc tile.
- b. Choose the Queues tab in the message client page and then choose Create Queue .
- c. Enter a queue name. Note that in the blue field of the Create a New Queue wizard, the final queue name is displayed. For example, if you write my-queue in the Queue Name field, the final queue name would be sap/S4HANAOD/ems-s4hc/my-queue . Choose Create .
5. Subscribe this queue to the channel topic that SAP S/4HANA Cloud tenant uses to produce events.
- a. From the Actions of your newly created queue, select Queue Subscriptions .
- b. In the Topic field, enter the topic you configured in the SAP S/4HANA Cloud tenant. For example, sap/S4HANAOD/s4hc/ce/sap/s4/beh/businesspartner/v1/BusinessPartner/Changed/v1 .
- c. Choose Add .
## Related Information
Manage Queues REST APIs for Events