Skip to main content
Lender is a single Go service, packaged as a container and configured entirely through environment variables. This page is the operator’s reference: what it runs as, what it depends on, the settings that matter, and how tenancy and ledger routing behave.

The container


Lender builds from a multi-stage Dockerfile — a Go Alpine builder producing a static binary, copied into a distroless nonroot runtime — and listens on port 8080. It ships as a container image you deploy into your cluster with the platform’s standard lifecycle tooling; this page does not assume any particular packaging beyond the image. Operational probes:
EndpointPurpose
GET /healthLiveness.
GET /readyzDependency readiness.
GET /versionBuild and version metadata.

Dependencies


DependencyRole
PostgreSQL 17Primary data store, with primary/replica support and schema-per-tenant isolation in multi-tenant mode.
Valkey 8 (Redis-compatible)Cache, rate limiting, and the M2M-credential cache.
RabbitMQEvent publisher transport, driven by a transactional outbox dispatcher.
RedPandaStreaming backbone for the lifecycle event catalog (via Lerian’s streaming library).
MidazThe double-entry , reached through the official SDK. Lender authenticates via Access Manager with per-tenant machine-to-machine (M2M) credentials, retrieved from AWS Secrets Manager and cached in Valkey.
CasdoorIdentity provider backing route authorization (via Lerian’s auth library).
SystemplaneRuntime configuration plane, mounted under /api/v1/systemplane.

Configuration surface


Configuration is entirely environment-driven. The keys below are a curated subset — the ones that shape behavior — not the full list.
GroupKeyWhat it controls
AppENV_NAME, LOG_LEVEL, DEPLOYMENT_MODE, SERVER_ADDRESSEnvironment name, log verbosity, deployment mode, and listen address.
TenancyMULTI_TENANT_ENABLED, DEFAULT_TENANT_IDSwitch between single- and multi-tenant modes, and the tenant used when single-tenant.
Tenancy (MT)MULTI_TENANT_MAX_TENANT_POOLS, MULTI_TENANT_CIRCUIT_BREAKER_THRESHOLDPer-tenant connection-pool ceiling and circuit-breaker trip point.
PostgresPOSTGRES_HOST, POSTGRES_PORT, POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_NAME, POSTGRES_SSLMODE, MIGRATIONS_PATHPrimary database connection and migrations.
CacheREDIS_HOST, REDIS_PASSWORD, M2M_CREDENTIAL_CACHE_TTL_SECValkey connection and how long M2M credentials are cached.
MessagingRABBITMQ_ENABLED, RABBITMQ_HOST, OUTBOX_ENABLED, OUTBOX_DISPATCH_INTERVAL_SECRabbitMQ transport and the outbox dispatcher cadence.
StreamingSTREAMING_ENABLED, STREAMING_BROKERS, STREAMING_TLS_ENABLEDEvent streaming toggle, broker addresses, and TLS.
AuthPLUGIN_AUTH_ENABLEDEnable route authorization against the identity provider.
Ledger M2MAWS_REGIONRegion for the Secrets Manager holding per-tenant Midaz credentials.
ObservabilityENABLE_TELEMETRY, OTEL_EXPORTER_OTLP_ENDPOINTTelemetry toggle and OTLP collector endpoint.
LimitsRATE_LIMIT_ENABLEDRequest rate limiting.
DocsSWAGGER_ENABLEDServe the OpenAPI document and API reference UI.

Multi-tenant modes


Lender runs in one of two modes:
  • Single-tenant — one tenant (DEFAULT_TENANT_ID), one database schema, and a construction-time ledger organization and ledger used as the posting default.
  • Multi-tenant (MULTI_TENANT_ENABLED=true) — schema-per-tenant persistence, a per-tenant Midaz client pool, and tenant-scoped events and postings. In this mode there is no env ledger default: the ledger target comes per transaction from the product’s accounting profile.

Ledger posting and fails-closed routing


Every financial event books to the ledger through a durable posting intent and an asynchronous relay — the full path is in Lender in the platform. The operationally important property: routing fails closed. A posting books into the ledger organization and ledger resolved from the accounting profile (single-tenant falls back to the env default); if neither resolves a non-empty target, Lender refuses to post rather than book into an empty or wrong ledger. Under multi-tenant mode, a product with no accounting profile therefore cannot post — which is the intended safeguard.

Next steps


Lender in the platform

The posting path, event catalog, and tenant isolation in detail.