Skip to main content

Ledger service configuration reference


The Ledger service uses module-specific database configurations:

External secrets support

Deployment flags reference

Environment variables reference

Detailed descriptions for variables that aren’t self-explanatory from the YAML block above.

Database connection pools

For production workloads, set explicit pool limits to prevent connection exhaustion. A common starting point: MAX_OPEN_CONNS=25, MAX_IDLE_CONNS=10 per database module. Tune based on your PostgreSQL max_connections setting and the number of Midaz replicas.

RabbitMQ

Audit logging

When enabled, Midaz publishes detailed operation-level audit logs to a RabbitMQ exchange after each transaction. The audit payload includes the full operation data (amounts, accounts, balances before/after) serialized as JSON. You consume these events by binding your own queue to the audit exchange.

Transaction events

Async transaction processing

When RABBITMQ_TRANSACTION_ASYNC is enabled, Midaz processes transactions asynchronously through RabbitMQ consumers instead of inline during the API request. The bulk recorder further batches database writes for higher throughput.
BULK_RECORDER_* variables only take effect when both RABBITMQ_TRANSACTION_ASYNC=true and BULK_RECORDER_ENABLED=true.

Pagination

The pagination date range limit prevents expensive full-table scans on large datasets. If your use case requires querying historical data beyond 3 months, increase this value or set it to 0 — but monitor query performance accordingly.