Event channels
Lerian STA publishes on these channels:
- An audit channel carrying the Lerian STA audit trail: credential changes, transfer state changes, operator actions, and inbound file outcomes. It feeds the Lerian STA audit log and runs when
AUDIT_PUBLISHER_ENABLEDistrue. - A signed business channel, routed as
sta.{direction}.{sanitized-source-product}with anunroutedfallback, for external product consumers. It carries six terminal transfer outcomes. The payload fieldstatusnames the state (Accepted,Rejected,Inconsistent,Canceled,DownloadFinished, orNotAuthorized), andoutcomereadsSUCCESS,FAILURE, orCANCELED. - The event stream, when
STREAMING_ENABLEDistrue. It carries the same outcomes as CloudEvents of typestudio.lerian.br-sta.br_sta_transfers.<event>, where<event>isaccepted,rejected,inconsistent,canceled,download_finished, ordownload_not_authorized.
error_code only for failed and canceled outcomes, and an operator cancel leaves it empty. Inbound-success events carry the claim-check.
The claim-check
On a completed inbound download, Lerian STA emits its terminal download-finished event, routed by the file’s source product. The event carries a claim-check (
object_key, sha256, size_bytes, and file_name), but not the bytes themselves. For inbound terminal facts, document_code carries the observed BACEN code. When the persisted mnemonic and code corroborate each other, document_type carries the mnemonic. Otherwise it retains the code for compatibility. An operator cancel of an inbound transfer carries neither field.
The consuming domain product subscribes to its own key. It fetches the durable artefact by its object key and re-verifies the SHA-256. It then reconciles the result into the client’s ledger. Lerian STA is the transport and integrity boundary. The consuming product owns the ledger posting.
Ledger boundary
Lerian STA does not write to the client’s ledger itself. It delivers the file and the claim-check. The consuming product performs the ledger reconciliation, for example Lerian SISBAJUD for judicial asset-order files. This keeps Lerian STA a pure transport-and-integrity layer, independent of any one file’s business meaning.
Integration conventions
- Commit-coupled events. A record written with a state change becomes available only after that change commits.
- Claim-check, not payload. Consumers receive a reference to the durable artefact, fetch it, and re-verify its SHA-256 before acting on it.
- At-least-once delivery. Deduplicate on the payload
event_id, which stays the same for one terminal fact. - Keyed subscription. Clients choose their broker subscriptions. STA routes signed business events by direction and sanitized source product, with an
unroutedfallback. It does not enforce that only one subscriber can receive a file.

