Skip to content
Packages Examples Agents Blog Get started

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 ORI_EVENTS__:

Terminal window
ORI_EVENTS__NAME=prod-events \
ORI_EVENTS__EVENT_STORE_BACKEND=postgres \
ORI_EVENTS__ENABLED=true

Config section key: events

KeyTypeDefaultEnv VarDescription
namestr"events"ORI_EVENTS__NAMEInstance name
enabledboolTrueORI_EVENTS__ENABLEDEnable events system
event_store_backendEventStoreBackend"memory"ORI_EVENTS__EVENT_STORE_BACKENDBackend: memory, postgres, mongodb, sqlite
debugboolFalseORI_EVENTS__DEBUGEnable debug mode
envstr | NoneNoneORI_EVENTS__ENVRuntime environment
postgresPostgresEventStoreConfig | NoneNoneORI_EVENTS__POSTGRES__*Postgres store config
mongodbMongoDBEventStoreConfig | NoneNoneORI_EVENTS__MONGODB__*MongoDB store config
memoryInMemoryEventStoreConfigdefaultsORI_EVENTS__MEMORY__*In-memory store config
sqliteSqliteConfig | NoneNoneORI_EVENTS__SQLITE__*SQLite store config
snapshotsSnapshotConfigdefaultsORI_EVENTS__SNAPSHOTS__*Snapshot config
command_busCommandBusConfigdefaultsORI_EVENTS__COMMAND_BUS__*Command bus config
query_busQueryBusConfigdefaultsORI_EVENTS__QUERY_BUS__*Query bus config
event_busEventBusConfigdefaultsORI_EVENTS__EVENT_BUS__*Event bus config
sagaSagaConfigdefaultsORI_EVENTS__SAGA__*Saga config
projectionProjectionConfigdefaultsORI_EVENTS__PROJECTION__*Projection config
streamingStreamingConfigdefaultsORI_EVENTS__STREAMING__*Streaming config
logging_middlewareLoggingMiddlewareConfigdefaultsORI_EVENTS__LOGGING_MIDDLEWARE__*Logging middleware
validation_middlewareValidationMiddlewareConfigdefaultsORI_EVENTS__VALIDATION_MIDDLEWARE__*Validation middleware
transaction_middlewareTransactionMiddlewareConfigdefaultsORI_EVENTS__TRANSACTION_MIDDLEWARE__*Transaction middleware
retry_middlewareRetryMiddlewareConfigdefaultsORI_EVENTS__RETRY_MIDDLEWARE__*Retry middleware
metrics_middlewareMetricsMiddlewareConfigdefaultsORI_EVENTS__METRICS_MIDDLEWARE__*Metrics middleware
rabbitmqRabbitMQConfig | NoneNoneORI_EVENTS__RABBITMQ__*RabbitMQ adapter config
kafkaKafkaConfig | NoneNoneORI_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
ORI_EVENTS__EVENT_STORE_BACKEND=postgres \
ORI_EVENTS__POSTGRES__DSN=postgresql://user:pass@localhost:5432/events \
ORI_EVENTS__SNAPSHOTS__ENABLED=true \
ORI_EVENTS__SNAPSHOTS__EVENT_COUNT_THRESHOLD=50 \
ORI_EVENTS__COMMAND_BUS__MAX_RETRIES=3 \
ORI_EVENTS__COMMAND_BUS__TIMEOUT_SECONDS=60 \
ORI_EVENTS__EVENT_BUS__PARALLEL_DISPATCH=true \
ORI_EVENTS__EVENT_BUS__CONTINUE_ON_ERROR=false \
ORI_EVENTS__EVENT_BUS__ENABLE_DEAD_LETTER=true