channel

Recipient (Kafka topic)

Kafka topic for the Recipient aggregate of CNA Pay - every CPF or CNPJ enabled to receive money on the platform. Carries the six facts of a recipient, owned by PAY and recorded by cna-pay in its outbox in the transaction of each change. Keyed by the recipient id. No consumer yet.

Channel KafkaNo consumer

Overview

Recipient is the verbatim AggregateRoot of the recipient event definitions owned by PayPayDomainv1.0.0Payments platform bounded context of the CNA network. Owns the PAY message contracts for the recipients that receive mon...Ownercna-platformMapView docs. CNA PayCNA PayServicev1.0.0Payments platform of the CNA network (recipients, their subaccounts at the payment vendor, bank accounts and gateway con...PublishesRecipientCreated, RecipientStateChanged +5Ownercna-platformMapRepoView docs records a fact of a recipient in its outbox, in the transaction of every change its master system has to know, and a separate publisher process sends it here:

Each message carries the public state of the recipient after the change, the same in every fact, plus the fields of its own change. The events share the topic and are told apart by metadata.event.

At least once. The publisher sends the payload the outbox kept, byte for byte, in an envelope it builds at each round, the events of one recipient in the order they were recorded, and marks an event published only once the brokers confirm it; a round that cannot record that sends it again, with the same payload and eventId and a new metadata.producedAt, the instant of that round. So a consumer can receive an event twice, and an older state after a newer one. Every payload therefore opens with two fields:

  • eventId: the unique, immutable id of the event, kept by every resend.
  • objectVersion: the version of the recipient after the change, from 1.

A consumer drops an event whose eventId it already applied, and a state older than the objectVersion it holds for that recipient. The facts of one change share their objectVersion, so a fact of the version it holds is still applied: Recipient Eligibility ChangedRecipient Eligibility ChangedEventv1.0.0An answer of what a recipient may do changed, transacting or withdrawing, such as when the vendor creates its subaccount...Ownercna-platformSchemaMapView docs comes right after Recipient Verification ChangedRecipient Verification ChangedEventv1.0.0The verification (KYC) status of a recipient changed as the payment vendor reflects it: its public state after the chang...Ownercna-platformSchemaMapView docs, and right before a fact of the bank account, with the same version.

Who receives it. The facts of a recipient go to its master system (cna-pay-docs RN-EVT-155). The One is the only client system in this delivery: a change of a CNA_INSTITUTE recipient fails whole until its topic exists, and no command creates one yet (cna-br/cna-pay#262, cna-br/cna-pay#297). The topic is the aggregate root, as for every topic of the catalog; a topic per client system (cna-pay-docs RN-EVT-200) waits for the catalog team (cna-br/cna-pay#104).

Nothing is published yet. cna-pay keeps these facts in its outbox and publishes none until its message is in this catalog (cna-pay-docs, Eventos, “Caminho dos eventos até o CNA Event Catalog”): the deployed cna-pay runs the API alone, without its publisher. Outside staging and production the publisher asks the broker to create a missing topic; the staging and production topics are provisioned.

Nothing consumes the topic yet. The expected first consumer is CNA OneCNA OneServicev1.0.0Franchise operating system (franchises and employees, pricing, products and learning books, school operations, receivabl...PublishesGrantApplicationAccess, EmployeeCreated +19SubscribesInviteUser, FranchiseCreated +17Ownercna-platformMapRepoView docs, the master system of the schools, the suppliers and the franchisor.

Message key

Messages are keyed on payload.id, the id of the recipient in cna-pay (RoutingKey returns ID.String()), so the events of one recipient land on one partition and keep their order.

Envelope

Every message on every CNA topic uses the same envelope. schema.json on each message page describes payload only.

{
"payload": {
"eventId": "0199c4a0-6f3e-7b21-9a4d-5e8f0c1d2b3a",
"objectVersion": 1,
"id": "01a1cc13-7e82-77b4-88f2-6d67b25bdb09",
"...": "see the schema on each message page"
},
"metadata": {
"event": "RecipientCreated",
"producedAt": "2026-11-18T12:00:00.000Z",
"owner": "PAY",
"producedBy": "PAY",
"version": "1.0.0"
}
}

owner is the contract owner from the definition; producedBy is the application that emitted the message (see The envelope in docs/modelling/02-mapping.md). Today. cna-pay sets owner from the definition (PAY), always sends producedBy: PAY, and also sends the contract version in metadata, as cna-one does. eventId and objectVersion travel in the payload, so the envelope stays the one every application shares. producedAt is the instant of the publication, in UTC with milliseconds.

Channel information

Address: Recipient
Protocol:
  • kafka

Custom properties

PropertyValue
Message Keyx-message-keyid
Aggregate Rootx-aggregate-rootRecipient