Message format
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:
-
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) object that includes the following fields:
-
type
– Type of change, such asADD
,MODIFY
,DELETE
, orRESYNC
. -
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 isMODIFY
. -
current
– Entry after the change in JSON format. This field is unavailable when the type isDELETE
.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 isRESYNC
orCREATE
.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:
{
"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:
{
"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:
{
"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.