Core Configuration
WowProperties
- Configuration class: WowProperties
- Prefix:
wow
| Name | Data Type | Description | Default Value |
|---|---|---|---|
enabled | Boolean | Enable/disable the Wow framework | true |
context-name | String | Bounded context name for the service | Falls back to (required) spring.application.name |
shutdown-timeout | Duration | Global deadline for quiescing and stopping the complete Wow runtime | 60s |
shutdown-quiet-period | Duration | Stable idle period required before dispatcher intake closes; new activity resets it | 1s |
shutdown-timeout must be positive. shutdown-quiet-period must be non-negative and strictly shorter than shutdown-timeout. Both durations must fit in a signed 64-bit nanosecond value.
wow:
enabled: true
context-name: order-service
shutdown-timeout: 120s
shutdown-quiet-period: 2sBusProperties
BusProperties is the shared configuration for CommandBus, EventBus, and StateEventBus.
- Configuration class: BusProperties
| Name | Data Type | Description | Default Value |
|---|---|---|---|
type | BusType | Message bus implementation type | kafka |
local-first | LocalFirstProperties | LocalFirst mode configuration |
BusType
enum class BusType {
KAFKA, // Apache Kafka (recommended for production)
REDIS, // Redis Streams
IN_MEMORY, // In-memory (for testing)
NO_OP; // No-op (for special cases)
}LocalFirst Mode
LocalFirst mode first attempts local runtime admission while always sending a distributed copy. The copy is marked locally handled only after every targeted local receiver accepts admission; otherwise it remains eligible for distributed processing.
Behavior and failure boundary
- Reduced latency: locally admitted messages avoid a broker round trip before processing.
- Admission-aware fallback: no subscriber, closed processing, or local-send failure leaves the distributed copy eligible for processing.
- No retroactive reroute: after local admission succeeds, a later handler failure follows the normal handler retry and acknowledgement policy; it does not re-enable the distributed copy.
Source: LocalFirstMessageBus.
| Name | Data Type | Description | Default Value |
|---|---|---|---|
local-first.enabled | Boolean | Enable LocalFirst mode | true |
Command Bus
- Configuration class: CommandProperties
- Prefix:
wow.command.
| Name | Data Type | Description | Default Value |
|---|---|---|---|
bus | BusProperties | Command bus configuration | |
idempotency | IdempotencyProperties | Command idempotency |
wow:
command:
bus:
type: kafka
local-first:
enabled: true
idempotency:
enabled: true
bloom-filter:
expected-insertions: 1000000
ttl: PT60S
fpp: 0.00001IdempotencyProperties
- Configuration class: IdempotencyProperties
| Name | Data Type | Description | Default Value |
|---|---|---|---|
enabled | boolean | Whether to enable | true |
bloom-filter | BloomFilter | BloomFilter |
BloomFilter
| Name | Data Type | Description | Default Value |
|---|---|---|---|
ttl | Duration | Time to live | Duration.ofMinutes(1) |
expected-insertions | Long | Expected number of insertions | 1000_000 |
fpp | Double | False positive probability | 0.00001 |
Event Bus
- Configuration class: EventProperties
- Prefix:
wow.event.
| Name | Data Type | Description | Default Value |
|---|---|---|---|
bus | BusProperties | Event bus configuration |
wow:
event:
bus:
type: kafka
local-first:
enabled: trueEvent Sourcing
EventStoreProperties
- Configuration class: EventStoreProperties
- Prefix:
wow.eventsourcing.store
| Name | Data Type | Description | Default Value |
|---|---|---|---|
storage | StorageType | Event store storage backend | mongo |
wow:
eventsourcing:
store:
storage: mongoStorageType
The StorageType enum is shared across the event store and snapshot store.
enum class StorageType {
MONGO,
REDIS,
ELASTICSEARCH,
IN_MEMORY,
DELAY
;
}SnapshotProperties
- Configuration class: SnapshotProperties
- Prefix:
wow.eventsourcing.snapshot
| Name | Data Type | Description | Default Value |
|---|---|---|---|
enabled | Boolean | Whether to enable snapshots | true |
strategy | Strategy | Snapshot strategy | all |
version-offset | Int | Version offset threshold | 5 |
storage | StorageType | Snapshot storage backend | mongo |
wow:
eventsourcing:
snapshot:
enabled: true
strategy: all
storage: mongoStrategy
enum class Strategy {
ALL,
VERSION_OFFSET,
;
}The snapshot storage property reuses the shared StorageType enum.
StorageRoutingProperties
Route different aggregates to different storage backends within a single service. When a matching route is configured, Wow installs a RoutingEventStore / RoutingSnapshotStore that dispatches per aggregate to the bound store, falling back to the default storage (wow.eventsourcing.store.storage / wow.eventsourcing.snapshot.storage) for unlisted aggregates.
- Configuration class: StorageRoutingProperties
- Prefix:
wow.eventsourcing.storage-routing
| Name | Data Type | Description | Default Value |
|---|---|---|---|
aggregates | Map<String, AggregateStorageRouteProperties> | Per-aggregate route keyed by aggregate name | {} (empty) |
Each aggregate route accepts an event and/or snapshot channel. A configured channel must set exactly one of storage or binding — an empty channel (e.g. event: {}) fails fast at startup. Omitting a channel entirely is what falls back to the default store.
| Name | Data Type | Description | Default Value |
|---|---|---|---|
storage | StorageType | Storage backend for this channel (overrides the default) | (required if binding absent) |
binding | String | Name of the bound store/query-service bean to use | (required if storage absent) |
wow:
eventsourcing:
storage-routing:
aggregates:
# Hot aggregate: keep events and snapshots in Redis for low latency
HotAggregate:
event:
storage: redis
snapshot:
storage: redis
# Cold aggregate: fall back to the default MongoDB store
# (no route entry needed — default applies)State Event Bus
- Configuration class: StateProperties
- Prefix:
wow.eventsourcing.state
| Name | Data Type | Description | Default Value |
|---|---|---|---|
bus | BusProperties | State event bus configuration |
wow:
eventsourcing:
state:
bus:
type: kafka
local-first:
enabled: truePrepare Key
- Prefix:
wow.prepare
| Name | Data Type | Description | Default Value |
|---|---|---|---|
enabled | Boolean | Enable PrepareKey functionality | true |
storage | PrepareStorage | Storage backend for PrepareKey | MONGO |
base-packages | List<String> | Base packages to scan for PrepareKey definitions | [] |
PrepareStorage Values
| Value | Description |
|---|---|
MONGO | MongoDB (recommended) |
REDIS | Redis |
wow:
prepare:
enabled: true
storage: mongo
base-packages:
- com.example.domainEnvironment-Specific Configuration
Development Environment
wow:
command:
bus:
type: in_memory
event:
bus:
type: in_memory
eventsourcing:
store:
storage: in_memory
snapshot:
storage: in_memoryProduction Environment
wow:
command:
bus:
type: kafka
local-first:
enabled: true
event:
bus:
type: kafka
local-first:
enabled: true
eventsourcing:
store:
storage: mongo
snapshot:
enabled: true
strategy: all
storage: mongoComplete Configuration Example
spring:
application:
name: order-service
wow:
enabled: true
context-name: order-service
shutdown-timeout: 120s
shutdown-quiet-period: 2s
command:
bus:
type: kafka
local-first:
enabled: true
event:
bus:
type: kafka
local-first:
enabled: true
eventsourcing:
store:
storage: mongo
snapshot:
enabled: true
strategy: all
storage: mongo
state:
bus:
type: kafka
local-first:
enabled: true
kafka:
bootstrap-servers:
- kafka-0:9092
- kafka-1:9092
- kafka-2:9092
topic-prefix: 'wow.'
mongo:
enabled: true
auto-init-schema: true
openapi:
enabled: true
webflux:
enabled: true
global-error:
enabled: true