Kafka Entity Change Event Processing
Platform engineers implementing or debugging how EIMP entity-change Kafka events are consumed and classified by
wallet-migration-service before being forwarded to wallet-customer-service.
This page owns the EIMP event contract: the Kafka payload schema, sample payloads, and how
wallet-migration-service classifies an event and derives the eimpDeleted flag. For what CCG actually does to a
customer record once an event is classified β the SPLIT/SPLIT_AND_MERGE/MERGE/DELETE business logic,
eimpDeleted branching, HSID handling, and status tracking β see
EIMP Split, Merge, and Delete Operations
in the Customers domain.
The EIMP event processing strategy classifies each event into an operation type from the records and
oldRecords arrays populated in the entityChange object.
The target enterprise identifier is determined by the masterIndividualIdentifier, and only this customer is updated if
found in Customer Service.
eventType field on the wirewallet-migration-service's EimpConsumer derives the reason (SPLIT, SPLIT_AND_MERGE, MERGE, DELETE) by
pattern-matching the changeType values present across records/oldRecords β don't go looking for an eventType
field in the raw payload, it doesn't exist. See Event classification in Migration Service
for the exact rules.
entityChange object schemaβ
The entityChange object describes which source records now belong to this EID and which previously did.
Schema and field reference
{
"entityChange": {
"lastUpdated": {
"sourceSystemTimestamp": "",
"sourceTimestamp": null,
"userId": null
},
"records": [
{
"oldEnterpriseId": "",
"sourceSystem": "",
"sourceRecordId": "",
"surrogateIdentifier": "",
"changeType": ""
}
],
"oldRecords": [
{
"newEnterpriseId": "",
"sourceSystem": "",
"sourceEntityId": "",
"surrogateIdentifier": "",
"changeType": ""
}
]
}
}
| Field | Description |
|---|---|
entityChange.lastUpdated.sourceSystemTimestamp | Timestamp from the originating source system. |
entityChange.lastUpdated.sourceTimestamp | Timestamp from the EiMP source layer (may be null). |
entityChange.lastUpdated.userId | User who triggered the change (null for algorithmic events). |
entityChange.records | Source records that now belong to this Golden Record. Populated on MERGE and SPLIT_AND_MERGE. |
records[].oldEnterpriseId | The EID the source record previously belonged to before moving to this GR. |
records[].sourceSystem | The originating source system (e.g., CSP_Facets). |
records[].sourceRecordId | The record identifier in the originating source system. |
records[].surrogateIdentifier | EiMP surrogate key for this source record. |
records[].changeType | The type of change applied to this record entry. |
entityChange.oldRecords | Source records that previously belonged to this GR but have since moved. Populated on SPLIT and SPLIT_AND_MERGE. |
oldRecords[].newEnterpriseId | The EID the source record has been moved to. |
oldRecords[].sourceSystem | The originating source system for this record. |
oldRecords[].sourceEntityId | The entity identifier in the originating source system. |
oldRecords[].surrogateIdentifier | EiMP surrogate key for this source record. |
oldRecords[].changeType | The type of change applied to this record entry. |
partyLinks object schemaβ
The partyLinks object lists the source records currently linked to the Golden Record, complementing entityChange
with the linkage reason code for each association.
Schema and field reference
{
"partyLinks": [
{
"lastUpdated": {
"sourceSystemTimestamp": "",
"sourceTimestamp": null,
"userId": null
},
"linkReasonCode": "",
"sourcePartyIdentifier": "",
"surrogateIdentifier": "",
"targetPartyIdentifier": ""
}
]
}
| Field | Description |
|---|---|
linkReasonCode | Numeric code indicating why the record is linked. See the linkage type codes table below. |
sourcePartyIdentifier | Identifier of the source party (member record) being linked. |
surrogateIdentifier | EiMP surrogate key for the party link entry. |
targetPartyIdentifier | Identifier of the target Golden Record (EID). |
Linkage type codesβ
| Code | Reason | Description |
|---|---|---|
2 | Link | Records are automatically merged via the EiMP algorithm when the merge threshold score is met. |
3 | Unlink | Records are automatically split from their assigned EID when the merge threshold is not met. A new EID is assigned to at least one member record. |
Sample event payloadsβ
The following examples are real payloads provided by the EiMP team. Each scenario shows both sides of an operation β i.e. every EID that receives an event for that operation β so the full picture of what EiMP publishes is clear.
These are the actual shapes to use when writing test fixtures for EimpConsumer's classification logic or for
EimpEventProcessor integration tests β they cover edge cases (brand-new records, memdrop deletions, multi-way
splits) that are easy to miss if you only test the common case.
Scenario 1 β Simple Split (new EID created)
Scenario 1 β Simple Split (new EID created)β
A record moves out of an existing EID into a brand new EID. EiMP publishes two events: one to the new EID (records joined) and one to the existing EID (records left).
New EID 5214230533 β records joined (changeType: merge, linkReasonCode: 2)β
{
"partyLinks": [
{
"surrogateIdentifier": "2099344117",
"targetPartyIdentifier": "5214230533",
"sourcePartyIdentifier": "5123077187",
"linkReasonCode": "2",
"lastUpdated": {
"sourceSystemTimestamp": "2024-02-05 13:39:39.000",
"sourceTimestamp": null,
"userId": null
}
},
{
"surrogateIdentifier": "2097428919",
"targetPartyIdentifier": "5214230533",
"sourcePartyIdentifier": "5123077187",
"linkReasonCode": "2",
"lastUpdated": {
"sourceSystemTimestamp": "2024-02-05 13:39:39.000",
"sourceTimestamp": null,
"userId": null
}
}
],
"entityChange": {
"lastUpdated": {
"sourceSystemTimestamp": "2024-02-05 13:39:39.000",
"sourceTimestamp": null,
"userId": null
},
"oldRecords": [],
"records": [
{
"changeType": "merge",
"oldEnterpriseId": "5123077187",
"sourceRecordId": "MOONEX 16168996201",
"sourceSystem": "CDB_AP",
"surrogateIdentifier": "2099344117"
},
{
"changeType": "merge",
"oldEnterpriseId": "5123077187",
"sourceRecordId": "161689962-01",
"sourceSystem": "CSP_Facets",
"surrogateIdentifier": "2097428919"
}
]
}
}
Existing EID 5123077187 β records left (changeType: split, linkReasonCode: 3)β
{
"partyLinks": [
{
"surrogateIdentifier": "2099344117",
"targetPartyIdentifier": "5214230533",
"sourcePartyIdentifier": "5123077187",
"linkReasonCode": "3",
"lastUpdated": {
"sourceSystemTimestamp": "2024-02-05 13:39:39.000",
"sourceTimestamp": null,
"userId": null
}
},
{
"surrogateIdentifier": "2097428919",
"targetPartyIdentifier": "5214230533",
"sourcePartyIdentifier": "5123077187",
"linkReasonCode": "3",
"lastUpdated": {
"sourceSystemTimestamp": "2024-02-05 13:39:39.000",
"sourceTimestamp": null,
"userId": null
}
}
],
"entityChange": {
"lastUpdated": {
"sourceSystemTimestamp": "2024-02-05 13:39:39.000",
"sourceTimestamp": null,
"userId": null
},
"oldRecords": [
{
"changeType": "split",
"newEnterpriseId": "5214230533",
"sourceRecordId": "MOONEX 16168996201",
"sourceSystem": "CDB_AP",
"surrogateIdentifier": "2099344117"
},
{
"changeType": "split",
"newEnterpriseId": "5214230533",
"sourceRecordId": "161689962-01",
"sourceSystem": "CSP_Facets",
"surrogateIdentifier": "2097428919"
}
],
"records": []
}
}
- The new EID (
5214230533) receivesrecords[]entries withchangeType: mergeandlinkReasonCode: 2(Link) β meaning records joined this EID. - The existing EID (
5123077187) receivesoldRecords[]entries withchangeType: splitandlinkReasonCode: 3(Unlink) β meaning those records left this EID. - CCG processes the event for the EID that matches the customer stored in Customer Service.
Scenario 2a β Overmerge correction, no new EID (records moved between existing EIDs)
Scenario 2a β Overmerge correction, no new EID (records moved between existing EIDs)β
A record moves from EID 1 into EID 2 (both already exist). This is a Split/Merge pair without a newly created EID.
EID 1 572655692 β record leftβ
{
"partyLinks": [
{
"surrogateIdentifier": "732572314",
"targetPartyIdentifier": "5214416707",
"sourcePartyIdentifier": "572655692",
"linkReasonCode": "3",
"lastUpdated": {
"sourceSystemTimestamp": "2024-02-06 18:53:14.000",
"sourceTimestamp": null,
"userId": null
}
}
],
"entityChange": {
"lastUpdated": {
"sourceSystemTimestamp": "2024-02-06 18:53:14.000",
"sourceTimestamp": null,
"userId": null
},
"oldRecords": [
{
"changeType": "split",
"newEnterpriseId": "5214416707",
"sourceRecordId": "SDMSDM75QP771299811610",
"sourceSystem": "RXCC",
"surrogateIdentifier": "732572314"
}
],
"records": []
}
}
EID 2 5214416707 β record joinedβ
{
"partyLinks": [
{
"surrogateIdentifier": "732572314",
"targetPartyIdentifier": "5214416707",
"sourcePartyIdentifier": "572655692",
"linkReasonCode": "2",
"lastUpdated": {
"sourceSystemTimestamp": "2024-02-06 18:53:14.000",
"sourceTimestamp": null,
"userId": null
}
}
],
"entityChange": {
"lastUpdated": {
"sourceSystemTimestamp": "2024-02-06 18:53:14.000",
"sourceTimestamp": null,
"userId": null
},
"oldRecords": [],
"records": [
{
"changeType": "merge",
"oldEnterpriseId": "572655692",
"sourceRecordId": "SDMSDM75QP771299811610",
"sourceSystem": "RXCC",
"surrogateIdentifier": "732572314"
}
]
}
}
Scenario 2b β Overmerge correction, new EIDs created (records split across multiple new EIDs)
Scenario 2b β Overmerge correction, new EIDs created (records split across multiple new EIDs)β
A single EID is split into two new EIDs. EiMP publishes three events: one to the original EID (all records left) and one to each new EID (their respective records joined).
EID 1 5214414483 β all records left (split into EID 2 and EID 3)β
{
"partyLinks": [
{
"surrogateIdentifier": "2265797275",
"targetPartyIdentifier": "5214416445",
"sourcePartyIdentifier": "5214414483",
"linkReasonCode": "3",
"lastUpdated": { "sourceSystemTimestamp": "2024-02-06 19:22:45.000", "sourceTimestamp": null, "userId": null }
},
{
"surrogateIdentifier": "2265798554",
"targetPartyIdentifier": "5214416445",
"sourcePartyIdentifier": "5214414483",
"linkReasonCode": "3",
"lastUpdated": { "sourceSystemTimestamp": "2024-02-06 19:22:45.000", "sourceTimestamp": null, "userId": null }
},
{
"surrogateIdentifier": "2265798550",
"targetPartyIdentifier": "5214416445",
"sourcePartyIdentifier": "5214414483",
"linkReasonCode": "3",
"lastUpdated": { "sourceSystemTimestamp": "2024-02-06 19:22:45.000", "sourceTimestamp": null, "userId": null }
},
{
"surrogateIdentifier": "2265798477",
"targetPartyIdentifier": "5214416446",
"sourcePartyIdentifier": "5214414483",
"linkReasonCode": "3",
"lastUpdated": { "sourceSystemTimestamp": "2024-02-06 19:22:45.000", "sourceTimestamp": null, "userId": null }
},
{
"surrogateIdentifier": "2265798472",
"targetPartyIdentifier": "5214416446",
"sourcePartyIdentifier": "5214414483",
"linkReasonCode": "3",
"lastUpdated": { "sourceSystemTimestamp": "2024-02-06 19:22:45.000", "sourceTimestamp": null, "userId": null }
}
],
"entityChange": {
"lastUpdated": { "sourceSystemTimestamp": "2024-02-06 19:22:45.000", "sourceTimestamp": null, "userId": null },
"oldRecords": [
{ "changeType": "split", "newEnterpriseId": "5214416445", "sourceRecordId": "MOONEX 96458721301", "sourceSystem": "CDB_AP", "surrogateIdentifier": "2265797275" },
{ "changeType": "split", "newEnterpriseId": "5214416445", "sourceRecordId": "0068465165165465465164968461", "sourceSystem": "CDB_CS", "surrogateIdentifier": "2265798554" },
{ "changeType": "split", "newEnterpriseId": "5214416445", "sourceRecordId": "124565681968494960026529684", "sourceSystem": "CDB_CS", "surrogateIdentifier": "2265798550" },
{ "changeType": "split", "newEnterpriseId": "5214416446", "sourceRecordId": "112654987-02", "sourceSystem": "CSP_Facets","surrogateIdentifier": "2265798477" },
{ "changeType": "split", "newEnterpriseId": "5214416446", "sourceRecordId": "100972~123564516584~2", "sourceSystem": "GPS", "surrogateIdentifier": "2265798472" }
],
"records": []
}
}
EID 2 5214416445 β 3 records joinedβ
{
"partyLinks": [
{ "surrogateIdentifier": "2265797275", "targetPartyIdentifier": "5214416445", "sourcePartyIdentifier": "5214414483", "linkReasonCode": "2", "lastUpdated": { "sourceSystemTimestamp": "2024-02-06 19:22:45.000", "sourceTimestamp": null, "userId": null } },
{ "surrogateIdentifier": "2265798554", "targetPartyIdentifier": "5214416445", "sourcePartyIdentifier": "5214414483", "linkReasonCode": "2", "lastUpdated": { "sourceSystemTimestamp": "2024-02-06 19:22:45.000", "sourceTimestamp": null, "userId": null } },
{ "surrogateIdentifier": "2265798550", "targetPartyIdentifier": "5214416445", "sourcePartyIdentifier": "5214414483", "linkReasonCode": "2", "lastUpdated": { "sourceSystemTimestamp": "2024-02-06 19:22:45.000", "sourceTimestamp": null, "userId": null } }
],
"entityChange": {
"lastUpdated": { "sourceSystemTimestamp": "2024-02-06 19:22:45.000", "sourceTimestamp": null, "userId": null },
"oldRecords": [],
"records": [
{ "changeType": "merge", "oldEnterpriseId": "5214414483", "sourceRecordId": "MOONEX 96458721301", "sourceSystem": "CDB_AP", "surrogateIdentifier": "2265797275" },
{ "changeType": "merge", "oldEnterpriseId": "5214414483", "sourceRecordId": "0068465165165465465164968461", "sourceSystem": "CDB_CS", "surrogateIdentifier": "2265798554" },
{ "changeType": "merge", "oldEnterpriseId": "5214414483", "sourceRecordId": "124565681968494960026529684", "sourceSystem": "CDB_CS", "surrogateIdentifier": "2265798550" }
]
}
}
EID 3 5214416446 β 2 records joinedβ
{
"partyLinks": [
{ "surrogateIdentifier": "2265798477", "targetPartyIdentifier": "5214416446", "sourcePartyIdentifier": "5214414483", "linkReasonCode": "2", "lastUpdated": { "sourceSystemTimestamp": "2024-02-06 19:22:45.000", "sourceTimestamp": null, "userId": null } },
{ "surrogateIdentifier": "2265798472", "targetPartyIdentifier": "5214416446", "sourcePartyIdentifier": "5214414483", "linkReasonCode": "2", "lastUpdated": { "sourceSystemTimestamp": "2024-02-06 19:22:45.000", "sourceTimestamp": null, "userId": null } }
],
"entityChange": {
"lastUpdated": { "sourceSystemTimestamp": "2024-02-06 19:22:45.000", "sourceTimestamp": null, "userId": null },
"oldRecords": [],
"records": [
{ "changeType": "merge", "oldEnterpriseId": "5214414483", "sourceRecordId": "112654987-02", "sourceSystem": "CSP_Facets", "surrogateIdentifier": "2265798477" },
{ "changeType": "merge", "oldEnterpriseId": "5214414483", "sourceRecordId": "100972~123564516584~2", "sourceSystem": "GPS", "surrogateIdentifier": "2265798472" }
]
}
}
Scenario 3 β Simple Merge / Undermerge (duplicate EID deleted)
Scenario 3 β Simple Merge / Undermerge (duplicate EID deleted)β
A record moves from a duplicate EID into an existing target EID. The source EID is deleted as a result.
Target (existing) EID 5063007019 β record joinedβ
{
"partyLinks": [
{
"surrogateIdentifier": "2142237885",
"targetPartyIdentifier": "5063007019",
"sourcePartyIdentifier": "5150382880",
"linkReasonCode": "2",
"lastUpdated": {
"sourceSystemTimestamp": "2024-02-06 18:28:02.000",
"sourceTimestamp": null,
"userId": null
}
}
],
"entityChange": {
"lastUpdated": {
"sourceSystemTimestamp": "2024-02-06 18:28:02.000",
"sourceTimestamp": null,
"userId": null
},
"oldRecords": [],
"records": [
{
"changeType": "merge",
"oldEnterpriseId": "5150382880",
"sourceRecordId": "PNX9012291085989000",
"sourceSystem": "CDB_CO",
"surrogateIdentifier": "2142237885"
}
]
}
}
Deleted EID 5150382880 β record left, EID subsequently removedβ
{
"partyLinks": [
{
"surrogateIdentifier": "2142237885",
"targetPartyIdentifier": "5063007019",
"sourcePartyIdentifier": "5150382880",
"linkReasonCode": "2",
"lastUpdated": {
"sourceSystemTimestamp": "2024-02-05 17:57:16.000",
"sourceTimestamp": null,
"userId": null
}
}
],
"entityChange": {
"lastUpdated": {
"sourceSystemTimestamp": "2024-02-05 17:57:16.000",
"sourceTimestamp": null,
"userId": null
},
"oldRecords": [
{
"changeType": "merge",
"newEnterpriseId": "5063007019",
"sourceRecordId": "PNX9012291085989000",
"sourceSystem": "CDB_CO",
"surrogateIdentifier": "2142237885"
}
],
"records": []
}
}
In this scenario the source EID's oldRecords[].changeType is merge (not split), because the record was
consumed into the target EID rather than forked to a new one. The source EID is then deleted by EiMP.
Scenario 4 β Brand new record added (merge-new)
Scenario 4 β Brand new record added (merge-new)β
A net-new source record is added to an existing EID for the first time. partyLinks is null and
oldEnterpriseId is null because the record did not previously belong to any EID.
{
"partyLinks": null,
"entityChange": {
"lastUpdated": {
"sourceSystemTimestamp": "2024-02-06 19:28:58.000",
"sourceTimestamp": null,
"userId": null
},
"oldRecords": [],
"records": [
{
"changeType": "merge-new",
"oldEnterpriseId": null,
"sourceRecordId": "135549877-01",
"sourceSystem": "CSP_Facets",
"surrogateIdentifier": "2265801124"
}
]
}
}
Scenario 5a / 5b β Memdrop deletion
Scenario 5a β Memdrop deletion (record dropped, EID remains)β
A single source record is dropped from an EID, but the EID itself is not deleted. partyLinks is null.
{
"partyLinks": null,
"entityChange": {
"lastUpdated": {
"sourceSystemTimestamp": "2024-02-06 19:32:07.000",
"sourceTimestamp": null,
"userId": null
},
"oldRecords": [
{
"changeType": "delete",
"newEnterpriseId": null,
"sourceRecordId": "0068465165165465465164968461",
"sourceSystem": "CDB_CS",
"surrogateIdentifier": null
}
],
"records": []
}
}