Events
How Redelay events work — definitions, publishing, consuming, and schema validation.
Events are the first-class citizens in Redelay. Every side effect — a user signing up, a domain dropping, an order placed — is modelled as an event.
Event message structure
Every event follows this envelope (flat field layout):
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"correlation_id": "7f3b1c2e-...",
"timestamp": "2026-04-07T09:00:00.000Z",
"entity_type": "order",
"entity_id": "order-123",
"action": "created",
"actor_type": "user",
"actor_id": "user-456",
"payload": "{\"order_id\":\"order-123\",\"total\":99.00}"
}
The entity_id is used as the Kafka partition key — all events for the same entity are ordered.
Defining events
Publishing events
Consuming events
Handler routing is by (entity_type, action) pair. Multiple handlers for the same pair are chained via EventMultiplexer.
Schema validation
Both services load the AsyncAPI schema from the backend on startup and validate every received event payload against it.
- Go:
SchemaRegistry.ValidatePayload(eventName, payload)— retries with backoff on startup - Python (coming soon): Generated at
/asyncapi/v1/schema.jsonby py-events
Correlation IDs
Always propagate correlation_id from an incoming event to any events you publish in response. This maintains trace chains across the entire pipeline.