ObjectStackObjectStack

Events Queue

Events Queue protocol schemas

Source: packages/spec/src/kernel/events/queue.zod.ts

TypeScript Usage

import { EventQueueConfigSchema, EventReplayConfigSchema, EventSourcingConfigSchema } from '@objectstack/spec/kernel';
import type { EventQueueConfig, EventReplayConfig, EventSourcingConfig } from '@objectstack/spec/kernel';

// Validate data
const result = EventQueueConfigSchema.parse(data);

EventQueueConfig

Properties

PropertyTypeRequiredDescription
namestringoptional (default: "events")Event queue name
concurrencyintegeroptional (default: 10)Max concurrent event handlers
retryPolicy{ maxRetries: integer; backoffStrategy: Enum<'fixed' | 'linear' | 'exponential'>; initialDelayMs: integer; maxDelayMs: integer }optionalDefault retry policy for events
deadLetterQueuestringoptionalDead letter queue name for failed events
priorityEnabledbooleanoptional (default: true)Process events based on priority

Nested Shape: EventQueueConfig.retryPolicy

PropertyTypeRequiredDescription
maxRetriesintegeroptional (default: 3)Max retries for failed events
backoffStrategyEnum<'fixed' | 'linear' | 'exponential'>optional (default: "exponential")Backoff strategy
initialDelayMsintegeroptional (default: 1000)Initial retry delay
maxDelayMsintegeroptional (default: 60000)Maximum retry delay

EventReplayConfig

Properties

PropertyTypeRequiredDescription
fromTimestampstringStart timestamp for replay (ISO 8601)
toTimestampstringoptionalEnd timestamp for replay (ISO 8601)
eventTypesstring[]optionalEvent types to replay (empty = all)
filtersRecord<string, any>optionalAdditional filters for event selection
speednumberoptional (default: 1)Replay speed multiplier (1 = real-time)
targetHandlersstring[]optionalHandler IDs to execute (empty = all)

EventSourcingConfig

Properties

PropertyTypeRequiredDescription
enabledbooleanoptional (default: false)Enable event sourcing
snapshotIntervalintegeroptional (default: 100)Create snapshot every N events
snapshotRetentionintegeroptional (default: 10)Number of snapshots to retain
retentionDaysintegeroptional (default: 365)Days to retain events
retentionneveroptional[REMOVED] EventSourcingConfig.retention was renamed to retentionDays in @objectstack/spec 17 — the unit of a duration-shaped number lives in the key name, not only in the describe prose. Rename the key to retentionDays; the value (days) is unchanged. The neighbouring snapshotRetention is a COUNT of snapshots, not a duration, so it keeps its name.
aggregateTypesstring[]optionalAggregate types to enable event sourcing for
storage{ type: Enum<'database' | 'file' | 's3' | 'eventstore'>; options?: Record<string, any> }optionalEvent store configuration

Nested Shape: EventSourcingConfig.storage

PropertyTypeRequiredDescription
typeEnum<'database' | 'file' | 's3' | 'eventstore'>optional (default: "database")Storage backend
optionsRecord<string, any>optionalStorage-specific options

On this page