Configuration properties
All framework properties live under the spring.ddd.* namespace and are bound automatically via Spring Boot @ConfigurationProperties.
Sensible defaults are chosen so most applications run without any explicit configuration.
All duration properties accept ISO-8601 duration strings (e.g. PT1S, PT30S, PT1M).
Event Sourcing
Prefix: spring.ddd.eventsourcing
These properties are shared across EventSourcingProperties (core runtime) and EventSourcingJdbcProperties (JDBC-specific), both bound under the same prefix.
| Property | Type | Default | Notes |
|---|---|---|---|
|
Boolean |
|
Master switch for the event-sourcing infrastructure. |
|
Boolean |
|
Run bean validation on an aggregate before persisting it. |
|
Boolean |
|
Enable snapshot creation to avoid replaying the full event stream. |
|
Long |
|
Number of events after which a new snapshot is created. |
|
Int |
|
Maximum number of aggregates fetched per round-trip when bulk-loading via |
|
|
|
SQL dialect for the JDBC event and snapshot stores. |
|
Boolean |
|
Apply the event-store and snapshot DDL scripts on startup. Idempotent — safe against an existing schema. Set to |
|
|
|
Base packages scanned for |
Partitioning
Prefix: spring.ddd.partitioning
This namespace configures the partition coordination substrate shared by CQRS and event sourcing, not an
event-sourcing-only concern: it applies equally to a partitioned @Partitioned projection in an application
with no event store at all.
Not every property in this namespace reaches every consumer of it: partitions, polling., instance.,
rebalance-interval and graceful-shutdown-timeout are module-agnostic — bound by PartitioningProperties
in spring-ddd-messaging, so they apply the same way whether or not JDBC coordination storage is on the
classpath. enabled, dialect and schema.auto are bound by PartitionCoordinationProperties in
spring-ddd-messaging-jdbc and reach only the JDBC half of the substrate: they decide whether the JDBC
coordination tables and beans exist at all, not how partitioning behaves once they do.
| Property | Type | Default | Notes |
|---|---|---|---|
|
Boolean |
|
Whether the JDBC partition coordination substrate is active. Set to |
|
|
|
Storage dialect for the coordination tables ( |
|
Boolean |
|
Apply the coordination tables' DDL script on startup. Idempotent — safe against an existing schema. Set to |
|
Int |
|
Fixed partition count for the event store; valid values are powers of two |
|
Int |
|
Max events read from one owned partition per poll page; bounds the poll batch. Must be at least |
|
Duration |
|
Polling cadence for partitioned event consumption. |
|
String |
host/pod name |
Stable, unique id for this process within a consumer’s set of instances. Defaults to the OS host name (falling back to a random id if unresolvable); set it explicitly when the host name is not stable or not unique, for example behind an orchestrator that recycles pod names. Must not be blank when set. |
|
Duration |
|
How often an instance renews its liveness row. Must be shorter than |
|
Duration |
|
An instance is considered dead once its last heartbeat is older than this, measured by the database clock. Also the ownership-lease duration. |
|
Duration |
|
How often an instance re-evaluates partition ownership across the live member set. Must be shorter than |
|
Duration |
|
Drain window an instance allows in-flight work before deregistering its membership and releasing its owned partitions on shutdown. |
All five durations must be positive.
instance.heartbeat-interval must be shorter than instance.stale-timeout, and rebalance-interval must be shorter than instance.stale-timeout — both keep an instance from being declared stale, or a rebalance from being skipped, before it has had a fair chance to renew.
CQRS commands & queries
Prefix: spring.ddd.cqrs
| Property | Type | Default | Notes |
|---|---|---|---|
|
Boolean |
|
Master switch for the CQRS infrastructure (commands, queries, projections). |
|
Boolean |
|
Enable the command pipeline ( |
|
Boolean |
|
Enable the query pipeline ( |
Projections
Prefix: spring.ddd.cqrs.projection
The properties below tune the one shared executor that every projection draws from. A given
projection’s own apply-concurrency cap is a separate, per-projection knob — the concurrency attribute
on @JsonProjection / @JpaProjection / @InMemoryProjection (default 0 = uncapped), overridable per
environment under overrides.<name>.concurrency (see Scaling overrides) — see
Scaling projections.
| Property | Type | Default | Notes |
|---|---|---|---|
|
Int |
available processors |
Worker threads in the shared keyed executor that partitions projection work by read-model id (same id serial, different ids parallel). |
|
Int |
|
Maximum attempts a projection makes to apply an event when it loses optimistic-lock races with a concurrent dispatcher. Each retry re-reads the row in a fresh transaction. |
|
Duration |
|
Base wait (full-jitter random in |
|
|
|
Application-wide error policy for persistent projections that do not declare their own policy. Must be |
|
Int |
|
Per-worker bounded queue capacity for the projection keyed executor. |
|
Int |
|
Per-projection cap on the number of in-memory read models. |
Projection consumer
Prefix: spring.ddd.cqrs.projection.consumer
Validation: polling.interval must be positive and strictly less than lease-ttl; lease-ttl must be at least 1 second (sub-second values truncate to zero in SQL and cause instant lease expiry).
| Property | Type | Default | Notes |
|---|---|---|---|
|
Duration |
|
Wake/poll cadence. The consumer also wakes on an after-commit signal. Must be positive and |
|
Int |
|
Maximum source-position window scanned per pass. |
|
Duration |
|
Single-consumer lease TTL; failover latency is approximately this value. Must be |
|
Int |
|
Maximum log positions the catch-up consumer dispatches ahead of the durable checkpoint before awaiting completions. Smaller values reduce crash re-work; larger values allow more parallelism slack. |
|
Int |
|
Total attempts (1 initial + retries) to apply a single event before the per-projection error policy fires. |
|
Duration |
|
Base backoff before the first apply retry. Must be positive. |
|
Double |
|
Exponential growth factor applied between apply retries. |
|
Duration |
|
Upper bound on the (multiplied) apply-retry backoff. Must be |
|
Duration |
|
How long a catch-up apply may block the consumer (awaiting keyed-executor capacity or a drain barrier) before a liveness warning is logged. Diagnostic only — the consumer keeps waiting. Must be positive. |
Projection high-water-mark
Prefix: spring.ddd.cqrs.projection.high-water-mark
Validation: polling.interval must be positive and strictly less than lease-ttl; lease-ttl must be at least 1 second.
| Property | Type | Default | Notes |
|---|---|---|---|
|
Duration |
|
Detector poll cadence. Must be positive. |
|
Int |
|
Maximum positions read per poll (bounds catch-up batch size). |
|
Duration |
|
Single-writer lease TTL; failover latency is approximately this value. Must be |
Cascade rebuild
Prefix: spring.ddd.cqrs.projection.cascade-rebuild
This same polling.interval also paces the in-place rebuild driver for @Partitioned projections - the two
pollers share one poll-cadence knob rather than each exposing its own.
| Property | Type | Default | Notes |
|---|---|---|---|
|
Duration |
|
Idle wait between driver ticks that advance in-progress projection rebuilds gated on upstream completion (both the cascade-rebuild driver and the |
|
Duration |
|
How long a persistent, event-sourced upstream may stall below its high-water mark before a blocked downstream rebuild logs a stall warning. Must be positive. |
|
Duration |
|
Hard ceiling after which a downstream rebuild HALTs if its persistent, event-sourced upstream stays stalled below the high-water mark. Must be positive and greater than |
Scaling overrides
Prefix: spring.ddd.cqrs.projection.overrides
Per-environment overrides of a projection’s two independent scaling levers — its apply-concurrency cap
and its @Partitioned opt-in — keyed by the projection’s storage name (overrides.<name>.*). Every field
defers to the projection’s annotation when unset — see
Scaling projections.
| Property | Type | Notes |
|---|---|---|
|
Int |
Overrides the projection annotation’s |
|
Boolean |
Overrides whether partitioned (cross-instance) consumption is active for this projection. Unset defers
to the annotation (enabled whenever |
Projection store
Prefix: spring.ddd.cqrs.projection.jdbc.store
This prefix configures the shared relational persistence layer (SQL dialect, bookkeeping tables) that all projection-store implementations use.
It has no dedicated enabled flag; the shared beans are contributed by whichever durable projection store is enabled (spring.ddd.cqrs.projection.json.enabled / spring.ddd.cqrs.projection.jpa.enabled), and shared via @ConditionalOnMissingBean when both are active.
| Property | Type | Default | Notes |
|---|---|---|---|
|
|
|
Database dialect for projection-store SQL. |
|
|
|
Whether to create missing projection-store bookkeeping tables on startup. |
|
Duration |
|
Lease TTL for an in-progress replay; renewed at half the duration. |
|
String |
|
Name of the read-model sidecar table. Override to match an existing schema. |
JSON projection store
Prefix: spring.ddd.cqrs.projection.json
Configures the JSON-over-JDBC projection store (@JsonProjection).
| Property | Type | Default | Notes |
|---|---|---|---|
|
Boolean |
|
Enable the |
|
String |
|
Shared table for |
|
|
|
Whether to create the JSON read-model tables ( |
CQRS JPA
Prefix: spring.ddd.cqrs.jpa
| Property | Type | Default | Notes |
|---|---|---|---|
|
Boolean |
|
Enable the JPA aggregate command-handler infrastructure. The |
JPA projection store
Prefix: spring.ddd.cqrs.projection.jpa
| Property | Type | Default | Notes |
|---|---|---|---|
|
Boolean |
|
Enable the |
CQRS–Event Sourcing bridge
Prefix: spring.ddd.cqrs.eventsourcing
| Property | Type | Default | Notes |
|---|---|---|---|
|
Boolean |
|
Enable the bridge that feeds committed events from the event store into the projection pipeline. |
Projection actuator
Prefix: spring.ddd.cqrs.projection.actuator
| Property | Type | Default | Notes |
|---|---|---|---|
|
Long? |
unset |
Optional lag threshold (in event positions). When set, a projection whose lag exceeds this value drives the health indicator DOWN. When unset, lag never affects health — operators alert on the |
Saga
Prefix: spring.ddd.saga
| Property | Type | Default | Notes |
|---|---|---|---|
|
Boolean |
|
Master switch for the saga runtime. |
|
String |
|
Table holding persisted saga instances. Must match the pattern |
|
Boolean |
|
Apply the saga instance table DDL on startup. Set to |
Saga deadlines
Prefix: spring.ddd.saga.deadline
Validation: both polling.interval and leaseTtl must be positive, and leaseTtl must strictly exceed polling.interval.
| Property | Type | Default | Notes |
|---|---|---|---|
|
Boolean |
|
Enable the deadline poller. |
|
Duration |
|
How often the single-active poller sweeps for due deadlines. Must be positive and |
|
Duration |
|
How long an acquired sweep lease is held. Must be positive and strictly exceed |
|
Int |
|
Maximum number of due deadlines fetched per sweep. |
|
String |
|
The deadline table. Must be a valid SQL identifier. |
|
String |
|
The sweep-lock table used for single-active leader election. Must be a valid SQL identifier. |
|
Boolean |
|
Apply the deadline and deadline-lock table DDL on startup. |
Saga inbound
Prefix: spring.ddd.saga.inbound
Validation: both polling.interval and leaseTtl must be positive, and leaseTtl must strictly exceed polling.interval; dispatchTimeout must be positive.
| Property | Type | Default | Notes |
|---|---|---|---|
|
Boolean |
|
Master switch for the ordered-inbound consumer. The bridge also gates on |
|
String |
|
Table holding per-saga-type inbound checkpoints and leases. Must be a valid SQL identifier. |
|
Duration |
|
How often the consumer wakes to check for new positions. Must be positive and |
|
Duration |
|
How long an acquired inbound lease is held. Must be positive and strictly exceed |
|
Int |
|
Maximum positions fetched per pass. Must be positive ( |
|
Duration |
|
Upper bound the consumer waits for a single record’s work to complete on the shared keyed executor before aborting the pass (the checkpoint stays unadvanced and the record is retried on the next poll). A liveness backstop against a permanently-wedged keyed task; set it well above the slowest legitimate handler-plus-transaction. Must be positive. |
|
Boolean |
|
Apply the inbound-checkpoint table DDL on startup. |
Saga retention
Prefix: spring.ddd.saga.retention
Deletes completed sagas whose completion is older than a configurable age. See Saga Retention for the guide.
Validation: polling.cron and polling.interval cannot both be set while enabled is true; lease-ttl
must be positive and, on the interval path, strictly exceed the effective poll interval; max-age (global
and per override) must be positive; polling.cron must be -, blank, or a valid cron expression;
polling.batch-size must be between 1 and 1000.
| Property | Type | Default | Notes |
|---|---|---|---|
|
Boolean |
|
Master switch for the retention sweeper. |
|
Duration |
|
Delete completed sagas whose completion is older than this. Must be positive. |
|
Duration |
(unset) |
Fixed-delay sweep cadence. Mutually exclusive with |
|
String |
|
Spring 6-field cron expression driving the sweep. |
|
Duration |
|
How long an acquired sweep lease is held. On the interval path it must exceed the effective poll interval; on the cron path it must be positive. |
|
Int |
|
Maximum rows deleted per statement; the sweep drains in batches of this size. Must be |
|
Boolean |
(inherits) |
Opt a saga type in or out, keyed by |
|
Duration |
(inherits) |
Per-type retention window. Falls back to the global |
Routing
Prefix: spring.ddd.routing
Map-typed properties are keyed by user-chosen names (rulesets, destinations) or by a message’s
canonical name (commands, queries) — <namespace>.<name> of its @Command/@Query, falling back to
the fully-qualified class name when it declares no namespaced name; see Routing.
| Property | Type | Default | Notes |
|---|---|---|---|
|
Boolean |
|
Gates the |
|
String |
— |
Transport id for the named destination. Must match a registered |
|
String |
|
Transport-specific address for the named destination; interpreted by the matching dispatcher. |
|
String |
— |
Static command route: message canonical name ( |
|
String |
— |
Static query route: message canonical name ( |
Spring Modulith properties
The following properties are not defined by Spring DDD. They are owned by Spring Modulith and the framework honors them because it integrates with the Modulith event-publication store. Consult the Spring Modulith Integration page and the upstream documentation for their meaning and defaults.
| Property | Purpose |
|---|---|
|
Whether Modulith marks event publications complete inline (SYNCHRONOUS) or asynchronously. |
|
Replay incomplete event publications on application restart. |
|
Controls which events are forwarded to an external message broker. |
|
Create the Modulith event-publication tables on startup. |
|
Schema name used for Modulith event-publication tables. |