Skip to main content
Lender publishes business facts and commands as CloudEvents 1.0 over Kafka. Publication is optional, tenant-scoped, and backed by a transactional outbox.

Turn publication on


Origination still works when publication is disabled. When publication is enabled, Lender fails startup if the broker or source configuration is invalid.

Wire contract


Lender uses the v3 application-stream contract. A topic identifies the producing application and message class, not one event. For example, a disbursement fact travels on lerian.streaming.lender with ce-type: studio.lerian.lender.loan_application.disbursed. ce-schemaversion carries the payload version. Schema v2 does not add a topic suffix under the v3 contract. Route on the CloudEvents headers, not on a per-event topic name.

Published contract


The manifest declares 35 definitions: 33 facts and two commands. Feature gates control individual integration paths, so consume only the contracts exposed by the deployed manifest. The two catalog commands are:
  • consignado.exclusao.requested: requests a consignado exclusion from the payroll rail.
  • consignado.redirecionamento.requested: requests a consignado redirection from the payroll rail.
See Lender event reference for every catalog definition and its source-qualified ce-type.

Events Lender consumes


Lender wires 15 gateway-facing fact keys from lerian.streaming.consignado-gw. The keys include contract registration, disbursement confirmation, averbação rejection, employment status, redirection outcomes, reconciliation, exclusion outcomes, correction availability, portability outcomes, and refinance outcomes. The corresponding consumers are configuration-gated. Portability and refinance each use one opt-in flag for their pair of outcomes. The gateway has emission paths for the first 13 keys. The portability pair reaches Lender only when its outcome consumer is enabled and the deployed gateway manifest declares the event. The manifest does not declare the two refinance outcomes, so those two listeners receive no live traffic from the current gateway runtime. A Lender handler consumes match_run.completed from lerian.streaming.matcher. For the default handoff, Matcher must use STREAMING_CLOUDEVENTS_SOURCE=matcher. Lender routes ce-source: matcher, ce-type: studio.lerian.matcher.match_run.completed, ce-resourcetype: match_run, and ce-eventtype: completed. If Matcher uses another source, inspect its streaming manifest and align both sides before enabling the runtimes. See Consignado privado for the payroll journey.

Durability and delivery


Lender writes each outbound business event to the PostgreSQL outbox in the same database transaction as the state change. A relay publishes it after commit. Broker delivery is at least once: deduplicate on (ce-source, ce-id) and make handlers idempotent. The relay retries each row up to OUTBOX_MAX_DISPATCH_ATTEMPTS times. The OUTBOX_RETRY_WINDOW_SEC value sets the minimum wait between attempts for a row. It is a per-attempt delay, not a total retry window. The defaults are 10 attempts and 300 seconds.

Payload conventions


Payloads are JSON facts, not diffs. Money and rate values use decimal strings rather than JSON numbers. Timestamps use RFC 3339 UTC. Read ce-schemaversion before decoding a versioned payload.

Check the deployed contract


GET /api/v1/streaming/manifest returns the deployed catalog, application topics, schema versions, and delivery policies. It requires a bearer token with streaming_manifest read. Read the manifest when your consumer starts and reject an unexpected source, event key, or schema version before processing traffic.

Next steps


Lender event reference

Inspect emitted, catalog-only, and consumed contracts.

Consignado privado

Follow the payroll command and fact flow.