Skip to content

Configuration

Configuration is loaded from the events: section of application.yaml and injected into EventsProvider via config_key = "events".

All keys can be overridden with environment variables using the prefix QK_EVENTS__:

Terminal window
QK_EVENTS__NAME=prod-events \
QK_EVENTS__EVENT_STORE_BACKEND=postgres \
QK_EVENTS__ENABLED=true

Config section key: events

KeyTypeDefaultEnv VarDescription
namestr"events"QK_EVENTS__NAMEInstance name
enabledboolTrueQK_EVENTS__ENABLEDEnable events system
event_store_backendEventStoreBackend"memory"QK_EVENTS__EVENT_STORE_BACKENDBackend: memory, postgres, mongodb, sqlite
debugboolFalseQK_EVENTS__DEBUGEnable debug mode
envstr | NoneNoneQK_EVENTS__ENVRuntime environment
postgresPostgresEventStoreConfig | NoneNoneQK_EVENTS__POSTGRES__*Postgres store config
mongodbMongoDBEventStoreConfig | NoneNoneQK_EVENTS__MONGODB__*MongoDB store config
memoryInMemoryEventStoreConfigdefaultsQK_EVENTS__MEMORY__*In-memory store config
sqliteSqliteConfig | NoneNoneQK_EVENTS__SQLITE__*SQLite store config
snapshotsSnapshotConfigdefaultsQK_EVENTS__SNAPSHOTS__*Snapshot config
command_busCommandBusConfigdefaultsQK_EVENTS__COMMAND_BUS__*Command bus config
query_busQueryBusConfigdefaultsQK_EVENTS__QUERY_BUS__*Query bus config
event_busEventBusConfigdefaultsQK_EVENTS__EVENT_BUS__*Event bus config
sagaSagaConfigdefaultsQK_EVENTS__SAGA__*Saga config
projectionProjectionConfigdefaultsQK_EVENTS__PROJECTION__*Projection config
streamingStreamingConfigdefaultsQK_EVENTS__STREAMING__*Streaming config
logging_middlewareLoggingMiddlewareConfigdefaultsQK_EVENTS__LOGGING_MIDDLEWARE__*Logging middleware
validation_middlewareValidationMiddlewareConfigdefaultsQK_EVENTS__VALIDATION_MIDDLEWARE__*Validation middleware
transaction_middlewareTransactionMiddlewareConfigdefaultsQK_EVENTS__TRANSACTION_MIDDLEWARE__*Transaction middleware
retry_middlewareRetryMiddlewareConfigdefaultsQK_EVENTS__RETRY_MIDDLEWARE__*Retry middleware
metrics_middlewareMetricsMiddlewareConfigdefaultsQK_EVENTS__METRICS_MIDDLEWARE__*Metrics middleware
rabbitmqRabbitMQConfig | NoneNoneQK_EVENTS__RABBITMQ__*RabbitMQ adapter config
kafkaKafkaConfig | NoneNoneQK_EVENTS__KAFKA__*Kafka adapter config
KeyTypeDefaultDescription
max_retriesint3Max command retry attempts
retry_delay_secondsfloat1.0Delay between retries
timeout_secondsfloat30.0Command execution timeout
enable_validationboolTrueEnable command validation
enable_loggingboolTrueEnable command logging
enable_metricsboolTrueEnable command metrics
KeyTypeDefaultDescription
max_concurrent_handlersint10Max concurrent event handlers
handler_timeout_secondsfloat30.0Per-handler timeout
retry_failed_handlersboolTrueRetry on handler failure
max_handler_retriesint3Max retries per handler
enable_dead_letterboolTrueEnable dead-letter queue
allow_no_handlersboolTrueAllow events with no handlers
parallel_dispatchboolTrueDispatch to handlers in parallel
continue_on_errorboolTrueContinue on handler error
max_queue_per_subscriberint1000Max queued events per subscriber
KeyTypeDefaultDescription
enabledboolTrueEnable aggregate snapshots
strategySnapshotStrategy"event_count"Strategy: event_count, time_based, on_demand
event_count_thresholdint100Events between snapshots
time_threshold_secondsint3600Seconds between time-based snapshots
max_snapshots_per_aggregateint5Max stored snapshots
events:
event_store_backend: memory
command_bus:
max_retries: 3
timeout_seconds: 30
event_bus:
parallel_dispatch: true
continue_on_error: true
events:
event_store_backend: postgres
postgres:
dsn: "postgresql://user:pass@localhost:5432/events"
schema: "events"
snapshots:
enabled: true
strategy: event_count
event_count_threshold: 50
command_bus:
max_retries: 3
timeout_seconds: 60
event_bus:
parallel_dispatch: true
continue_on_error: false
enable_dead_letter: true
Terminal window
QK_EVENTS__EVENT_STORE_BACKEND=postgres \
QK_EVENTS__POSTGRES__DSN=postgresql://user:pass@localhost:5432/events \
QK_EVENTS__SNAPSHOTS__ENABLED=true \
QK_EVENTS__SNAPSHOTS__EVENT_COUNT_THRESHOLD=50 \
QK_EVENTS__COMMAND_BUS__MAX_RETRIES=3 \
QK_EVENTS__COMMAND_BUS__TIMEOUT_SECONDS=60 \
QK_EVENTS__EVENT_BUS__PARALLEL_DISPATCH=true \
QK_EVENTS__EVENT_BUS__CONTINUE_ON_ERROR=false \
QK_EVENTS__EVENT_BUS__ENABLE_DEAD_LETTER=true