Kafka Events

26 Kafka event topics published by the Residency Service using CloudEvents 1.0 format.

CloudEvents 1.0 envelope formatjson
{
  "specversion": "1.0",
  "id": "evt_550e8400-e29b-41d4-a716-446655440000",
  "source": "residency-svc",
  "type": "eventzr.residency.policy.created.v1",
  "time": "2026-03-01T12:00:00.000Z",
  "datacontenttype": "application/json",
  "subject": "policy-uuid",
  "tenantid": "tenant-uuid",
  "data": {
    "id": "policy-uuid",
    "tenantId": "tenant-uuid",
    "name": "EU Data Residency Policy",
    "status": "active"
  }
}

Topic Naming Convention

All topics follow the pattern: eventzr.residency.<entity>.<action>.v1

Partition key: tenant_id — ensures all events for a tenant are processed in order.

Domain Summary

Policy (3)Classification (2)Consent (2)DSAR (2)Compliance (2)Data Flow (2)DPA (2)Framework (1)Location (1)PIA (2)Breach (3)Retention (1)Transfer (3)
TopicDomainActionDescription
eventzr.residency.policy.created.v1PolicyCreatedEmitted when a new residency policy is created
eventzr.residency.policy.updated.v1PolicyUpdatedEmitted when a residency policy is updated
eventzr.residency.policy.deleted.v1PolicyDeletedEmitted when a residency policy is deleted
eventzr.residency.classification.created.v1ClassificationCreatedEmitted when a data classification is created
eventzr.residency.classification.updated.v1ClassificationUpdatedEmitted when a data classification is updated
eventzr.residency.consent.created.v1ConsentCreatedEmitted when a consent record is created
eventzr.residency.consent.revoked.v1ConsentRevokedEmitted when consent is revoked by a subject
eventzr.residency.dsar.submitted.v1DSARSubmittedEmitted when a new DSAR is submitted
eventzr.residency.dsar.completed.v1DSARCompletedEmitted when a DSAR is completed
eventzr.residency.compliance.check-completed.v1ComplianceCompletedEmitted when a compliance check finishes
eventzr.residency.compliance.violation-detected.v1ComplianceDetectedEmitted when a compliance violation is found
eventzr.residency.data-flow.created.v1Data FlowCreatedEmitted when a data flow mapping is created
eventzr.residency.data-flow.anomaly-detected.v1Data FlowDetectedEmitted when an anomaly is detected in data flows
eventzr.residency.dpa.created.v1DPACreatedEmitted when a DPA is created
eventzr.residency.dpa.expired.v1DPAExpiredEmitted when a DPA expires
eventzr.residency.framework.registered.v1FrameworkRegisteredEmitted when a regulatory framework is registered
eventzr.residency.location.created.v1LocationCreatedEmitted when a data storage location is created
eventzr.residency.pia.submitted.v1PIASubmittedEmitted when a PIA is submitted for review
eventzr.residency.pia.approved.v1PIAApprovedEmitted when a PIA is approved
eventzr.residency.breach.reported.v1BreachReportedEmitted when a data breach is reported
eventzr.residency.breach.resolved.v1BreachResolvedEmitted when a breach is resolved
eventzr.residency.breach.notification-sent.v1BreachSentEmitted when a breach notification is sent to authorities
eventzr.residency.retention.executed.v1RetentionExecutedEmitted when a retention policy execution completes
eventzr.residency.transfer.requested.v1TransferRequestedEmitted when a cross-border transfer is requested
eventzr.residency.transfer.approved.v1TransferApprovedEmitted when a cross-border transfer is approved
eventzr.residency.transfer.blocked.v1TransferBlockedEmitted when a cross-border transfer is blocked

Consumer Configuration

Kafka consumer setuptypescript
import { KafkaBrokerModule } from '@eventzr/kafka';

// Subscribe to residency events
@Module({
  imports: [
    KafkaBrokerModule.forAws({
      clientId: 'my-service',
      groupId: 'my-service-residency-consumer',
      topics: [
        'eventzr.residency.breach.reported.v1',
        'eventzr.residency.compliance.violation-detected.v1',
      ],
    }),
  ],
})
export class ResidencyEventsModule {}