---
title: Message format
description: The distinguished name (DN) of a changed entry represents the default key for published messages. This value can be overridden in either of the following ways:
component: pingdirectory
version: 11.0
page_id: pingdirectory:pingdatasync_server_administration_guide:pd_sync_message_format
canonical_url: https://docs.pingidentity.com/pingdirectory/11.0/pingdatasync_server_administration_guide/pd_sync_message_format.html
revdate: September 13, 2023
page_aliases: ["pd_sync_ex_add.adoc", "pd_sync_ex_modify.adoc", "pd_sync_ex_delete.adoc", "pd_sync_message_customization.adoc"]
section_ids:
  example-add: Example ADD
  example-modify: Example MODIFY
  example-delete: Example DELETE
  message-customization: Message customization
---

# Message format

The distinguished name (DN) *(tooltip: \<div class="paragraph">
\<p>A name uniquely identifying an object within the hierarchy of a directory tree.\</p>
\</div>)* of a changed entry represents the default key for published messages. This value can be overridden in either of the following ways:

* With the `message-key-attribute` property of the Kafka sync destination configuration object

* With a `KafkaSyncDestinationPlugin` extension point

The value of the message is a JavaScript Object Notation (JSON) *(tooltip: \<div class="paragraph">
\<p>An open, lightweight data-interchange format that uses human-readable text to store and transmit data.\</p>
\</div>)* object that includes the following fields:

* `type` – Type of change, such as `ADD`, `MODIFY`, `DELETE`, or `RESYNC`.

* `dn` – DN of the changed entry.

* `changeID` – Unique identifier for the change.

* `modifiedAttributes` – List of modified attributes. This field is available only when the type is `MODIFY`.

* `current` – Entry after the change in JSON format. This field is unavailable when the type is `DELETE`.

  The JSON format of a `current` entry is compatible with the PingDirectory REST API.

* `previous` – Entry before the change in JSON format. This field is unavailable if the type is `RESYNC` or `CREATE`.

  The JSON format of a `previous` entry is compatible with the PingDirectory REST API.

## Example ADD

The following code provides an example of an addition:

```json
{
  "type": "ADD",
  "dn" : "uid=jsmith,ou=people,dc=example,dc=com",
  "changeID": "changeNumber=1",
  "current": {
    "objectClass": [
      "top",
      "person",
      "organizationalPerson",
      "iNetOrgPerson"
    ],
    "sn": [
      "Smith"
    ],
    "cn": [
      "John Smith"
    ],
    "telephoneNumber": [
      "+1 123 123 1234"
    ],
    "uid": [
      "jsmith"
    ]
  }
}
```

## Example MODIFY

The following code provides an example of a modification:

```json
{
  "type": "MODIFY",
  "dn" : "uid=jsmith,ou=people,dc=example,dc=com",
  "changeID": "changeNumber=2",
  "modifiedAttributes": [
    "telephoneNumber"
  ],
  "previous": {
    "telephoneNumber": [
      "+1 123 123 1234"
    ],
    "objectClass": [
      "top",
      "person",
      "organizationalPerson",
      "iNetOrgPerson"
    ],
    "sn": [
      "Smith"
    ],
    "cn": [
      "John Smith"
    ],
    "uid": [
      "jsmith"
    ]
  },
  "current": {
    "telephoneNumber": [
      "+1 321 321 3210"
    ],
    "objectClass": [
      "top",
      "person",
      "organizationalPerson",
      "iNetOrgPerson"
    ],
    "sn": [
      "Smith"
    ],
    "cn": [
      "John Smith"
    ],
    "uid": [
      "jsmith"
    ]
  }
}
```

## Example DELETE

The following code provides an example of a deletion:

```json
{
  "type": "DELETE",
  "dn" : "uid=jsmith,ou=people,dc=example,dc=com",
  "changeID": "changeNumber=3",
  "previous": {
    "telephoneNumber": [
      "+1 321 321 3210"
    ],
    "objectClass": [
      "top",
      "person",
      "organizationalPerson",
      "iNetOrgPerson"
    ],
    "sn": [
      "Smith"
    ],
    "cn": [
      "John Smith"
    ],
    "uid": [
      "jsmith"
    ]
  }
}
```

## Message customization

After PingDataSync maps the attributes and filters the results, any entries that are changed will use the fields of a Kafka message. To restrict the information that is published to a topic, exclude the unwanted attributes from mapping, or include only the attributes that you want to publish.

By using the `KafkaSyncDestinationPlugin` extension point within the Server SDK, you can fully change the message key or value. For more information, including examples, see the documentation that is included with the Server SDK packaging.
