> For the complete documentation index, see [llms.txt](https://docs.cennso.com/components/tposs/latest/llms.txt) (all documentation: [llms.txt](https://docs.cennso.com/llms.txt)). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cennso.com/components/tposs/latest/configuration/nats-services/cdmp.md).

# CDMP service

To configure a NATS service that TPOSS should use to communicate with SMF over Cennso Proxy, you must enable it first by setting the following parameters:

- **cdmp.enabled** - Enables support for CDMP in TPOSS.
- **cdmp.service** - CDMP service name. The value of the **cdmp.service** must point to the `SERVICE_NAME` that matches one of the NATS services defined in the `nats-services`.
- **nats-services.{SERVICE_NAME}.enabled** - Enables a NATS service for communication over Cennso Proxy.

For example:

```yaml
cdmp:
  enabled: true
  service: "tposs-cdmp-service"

nats-services:
  tposs-cdmp-service:
    enabled: true
```

In this example, TPOSS starts CDMP services to communicate with Cennso Proxy. To specify the address of Cennso Proxy, use the **nats-services.{SERVICE_NAME}.server** configuration parameter.

A NATS service responsible for communication over Cennso Proxy is a usual NATS service to which all the [generic configuration](https://docs.cennso.com/components/tposs/latest/configuration/nats-services/nats-service.md) options are applicable. In addition, there are three configuration options specific only to communication with Cennso Proxy:

- **nats-services.{SERVICE_NAME}.service_uri** - CDMP service URI registered by TPOSS.
- **nats-services.{SERVICE_NAME}.cluster_name** - CDMP cluster name.
- **nats-services.{SERVICE_NAME}.service_name** - CDMP service name registered by TPOSS.

> [!IMPORTANT]
> The **nats-services.{SERVICE_NAME}.service_uri** must be a valid URI ending with `/`.

See the example of the full NATS service configuration that TPOSS uses to communicate over Cennso Proxy:

```yaml
cdmp:
  enabled: true
  service: "tposs-cdmp-service"

nats-services:
  tposs-cdmp-service:
    # Enables support for communication with SMF over Cennso Proxy.
    enabled: true
    # Endpoint of the CDMP server.
    server: "localhost:4222"
    # Number of the client connections established to the CDMP server.
    # TPOSS uses three types of CDMP clients, so the total number of connections is this
    # number multiplied by 3.
    pool_size: 10
    # Maximum number of connections established to the CDMP server.
    # Initially, TPOSS creates the number of connections specified in
    # **nats-services.cdmp.pool_size**. If this number is not sufficient for the given load, TPOSS
    # establishes additional connections, up to this value.
    max_connections: 10
    # Timeout in milliseconds that specifies the maximum wait time for a response from the NATS server.
    recv_timeout: 3000
    # Timeout in milliseconds that specifies the maximum wait time for the underlying TCP stack to accept a send operation.
    send_timeout: 3000
    # Timeout in milliseconds to wait for the establishment of the connection to a NATS server.
    connection_timeout: 3000
    # Timeout in milliseconds to reconnect to a NATS server in case the connection is lost.
    backoff_period: 1000
    # CDMP service URI registered by TPOSS.
    service_uri: "http://cdmp.tposs.cennso.com/"
    # CDMP cluster name.
    cluster_name: "cdmp"
    # CDMP service name registered by TPOSS.
    service_name: "TPOSS CDMP service"
```
