## 5.6.2.3.3.3  Define SAP Event Mesh Service Descriptor JSON/ YAML File
The SAP Event Mesh service descriptor defines details of a message client and needs to be provided when provisioning new SAP Event Mesh service instances with service plan default .
## Prerequisites
- You have created an SAP S/4HANA Cloud Extensibility service instance with defined SAP S/4HANA Cloud Extensibility descriptor. See Define SAP S/4HANA Cloud Extensibility Service Descriptor JSON/YAML File [page 2145].
- Get to know the additional parameters you can have in the SAP Event Mesh service descriptor. In this page only the parameters that are related to this use case are described. See Syntax for Service Descriptor in SAP Event Mesh documentation.
## Context
You set up service instance of the SAP Event Mesh service to receive the events which are sent by the SAP S/ 4HANA Cloud Extensibility service. In the JSON file for the Cloud Foundry environment and in the YAML file for the Kyma environment, this service instance needs to be created with a different emname as well as a different namespace . The rule set here is important as each client should only publish in its own namespace. Since this message client's purpose is to receive messages from a different client, the rules of the subscribeFilter for topics need to take care of that. So the value of the message client defined in the SAP Event Mesh JSON/YAML file has to be configured to have the value of the subscribeFilter to be the same as the value of the namespace of the other client defined in the SAP S/4HANA Cloud Extensibility JSON/YAML file.
After both message clients are set up, you have to create a queue in the message client which refers to the SAP Event Mesh service instance. You can name the queue as you like and it will be created in the namespace of the client. This queue can now be subscribed to the topic configured step 7 in the Create an SAP S/4HANA Extensibility Service Instance in the Cloud Foundry Environment [page 2141] page. This topic in defined in the namespace of the S/4HANA Cloud Extensibility service descriptor, for example sap/S4HANAOD/s4hc/ myTopic .
The service instance of SAP Event Mesh is the message client which consumes the messages and should be bound to the actual application. These are the important aspects of the whole configuration:
- When creating a service instance of the SAP S/4HANA Cloud Extensibility service:
- Use unique emname per subaccount
- Use unique namespace per subaccount, for example a/b/c
- When creating a service instance of the SAP Event Mesh service:
- Use unique emname per subaccount
- Use unique namespace per subaccount, for example d/e/f
- Use the namespace defined in the SAP S/4HANA Cloud Extensibility JSON/YAML file and put it in the subscribeFilter parameter
## JSON:
<!-- image -->
## YAML:
<!-- image -->
- Create queue for this client
- Subscribe this queue to the topic defined in the namespace of the SAP S/4HANA Cloud Extensibility JSON/YAML file
<!-- image -->
## Procedure
Define the JSON file for the SAP Event Mesh service instance following the requirements for the properties and their values listes below:
## Parameter
emname
## version
## Description
Specifies the name of the SAP Event Mesh client. It is used by SAP Event Mesh to identify clients.
##  Note
The emname parameter in this descriptor must be unique per subaccount, so it must have the different value than the emname parameter in the SAP S/4HANA Cloud service descriptor. See Define SAP S/4HANA Cloud Extensibility Service Descriptor JSON/YAML File [page 2145].
## Rules/Guidelines
- Required: Yes
- Allowed characters: [a-zA-Z0-9\_-]
- Max length: 100
Rules/Guidelines: It is unique within a subaccount.
It specifies the version of the service descriptor.
##  Note
The version parameter is optional when you use the deprecated syntax. See Syntax for Service Descriptor.
## Rules/Guidelines
- Required: Yes
- Allowed value: 1.1.0
| Parameter     | Description                                                                                                                                    |
|---------------|------------------------------------------------------------------------------------------------------------------------------------------------|
| namespace     | Namespace for the messaging client.                                                                                                            |
| options       | Defines the access channels for the message client.                                                                                            |
| management •  | An options attribute. Enables/disables the usage of the management REST APIs. Rules/Guidelines • Default: false • Allowed values: true | false |
| messagingrest | An options attribute. Enables/Disables the usage of the messaging REST APIs. Rules/Guidelines • Default: false • Allowed values: true | false  |
| messaging     | An options attribute. Enables/disables the usage of the messaging gateway. Rules/Guidelines • Default: true • Allowed values: true | false     |
rules topicRules
subscribeFilter
## JSON File Example
```
{ "emname": "ems-s4hc", "version": "1.1.0", "options": { "management": true, "messagingrest": true, "messaging": true },
```
```
"namespace": "sap/S4HANAOD/ems-s4hc", "rules": {
```
Defines the access privileges of the messaging client.
## Rules/Guidelines
- Required: true
- Guidelines/Rules: In order to allow access to a queue or a topic, the namespace of the corresponding owner client has to be added. The placeholder $ {namespace} can be used instead of the defined namespace.
A rules attribute.
## Rules/Guidelines
- Type: Object
A topicRules attribute.
Filters from which topics a client (receiver) is allowed to receive messages.
## Rules/Guidelines
- Type: Array
- Allowed characters: [a-zA-Z*?/]
- Default: no default
- Example values: ${namespace}/foo/bar/* , $ {namespace}/* .
##  Note
The namespace part of the value must be specified exactly as the namespace value of the SAP S/4HANA Cloud Extensibility service descriptor JSON File descri- bed in Define SAP S/4HANA Cloud Extensibility Service Descriptor JSON/YAML File [page 2145].
```
"queueRules": { "subscribeFilter": [ "${namespace}/*" ] }, "topicRules": { "subscribeFilter": [ "${namespace}/*", "sap/S4HANAOD/s4hc/*" ] } } }
```
## YAML File Example
```
spec: externalName: '' serviceOfferingName: enterprise-messaging servicePlanName: default parameters: emname: ems-s4hc namespace: sap/S4HANAOD/ems-s4hc version: 1.1.0 options: management: true messagingrest: true messaging: true rules: queueRules: subscribeFilter: - "${namespace}/*" topicRules: subscribeFilter: - "${namespace}/*" - sap/S4HANAOD/s4hc/*
```
## Related Information
Syntax for Service Descriptor in SAP Event Mesh documentation