Events Queue
Events Queue protocol schemas
Event Queue Configuration Schema
Configuration for async event processing queue
@example
{
"name": "event_queue",
"concurrency": 10,
"retryPolicy": {
"maxRetries": 3,
"backoffStrategy": "exponential"
}
}
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
| Property | Type | Required | Description |
|---|---|---|---|
| name | string | ✅ | Event queue name |
| concurrency | integer | ✅ | Max concurrent event handlers |
| retryPolicy | { maxRetries: integer; backoffStrategy: Enum<'fixed' | 'linear' | 'exponential'>; initialDelayMs: integer; maxDelayMs: integer } | optional | Default retry policy for events |
| deadLetterQueue | string | optional | Dead letter queue name for failed events |
| priorityEnabled | boolean | ✅ | Process events based on priority |
EventReplayConfig
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| fromTimestamp | string | ✅ | Start timestamp for replay (ISO 8601) |
| toTimestamp | string | optional | End timestamp for replay (ISO 8601) |
| eventTypes | string[] | optional | Event types to replay (empty = all) |
| filters | Record<string, any> | optional | Additional filters for event selection |
| speed | number | ✅ | Replay speed multiplier (1 = real-time) |
| targetHandlers | string[] | optional | Handler IDs to execute (empty = all) |
EventSourcingConfig
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| enabled | boolean | ✅ | Enable event sourcing |
| snapshotInterval | integer | ✅ | Create snapshot every N events |
| snapshotRetention | integer | ✅ | Number of snapshots to retain |
| retention | integer | ✅ | Days to retain events |
| aggregateTypes | string[] | optional | Aggregate types to enable event sourcing for |
| storage | { type: Enum<'database' | 'file' | 's3' | 'eventstore'>; options?: Record<string, any> } | optional | Event store configuration |