A3S Docs
A3S Event

Schemas And Routing

Typed events, schema compatibility, CloudEvents conversion, broker/trigger routing, sinks, and DLQ.

Schemas And Routing

A3S Event separates provider transport from application-level semantics. Schemas, CloudEvents conversion, broker/trigger routing, sinks, and DLQ handling sit above the provider layer.

Schema Registry

SchemaRegistry stores EventSchema definitions keyed by event type and version. The built-in MemorySchemaRegistry is intended for development and testing.

CapabilityBehavior
RegisterEvent type must be non-empty; version must be >= 1.
ValidateRequired top-level payload fields are checked for registered typed events.
Untyped eventsEvents with empty event_type pass validation.
Missing schemaTyped events without a registered schema pass through.
CompatibilityBackward, Forward, Full, or None.

Compatibility checks only reason about required top-level fields:

ModeRule
BackwardNew schema cannot add new required fields that old consumers would miss.
ForwardNew schema cannot remove required fields from the previous version.
FullRequired fields must be identical between adjacent versions.
NoneSkip compatibility checks.

CloudEvents

With the cloudevents feature, events can be converted to and from CloudEvents v1.0 envelopes. Use this when the event crosses systems that already understand CloudEvents. Provider-native subjects still carry delivery and filtering.

Conversion is intentionally lossless for A3S-created events:

CloudEvents fieldA3S mapping
idEvent.id
sourceEvent.source
typeEvent.event_type, or a3s.event when the event is untyped.
subjectEvent.subject
dataEvent.payload
timeEvent.timestamp converted to RFC 3339 milliseconds.
a3scategoryExtension for Event.category.
a3sversionExtension for Event.version.
a3ssummaryExtension for Event.summary.
a3stimestampExtension for the original Unix millisecond timestamp.
a3smeta_<key>Extension entries for string metadata.

External CloudEvents that do not include A3S extensions still convert into Event; missing A3S fields fall back to empty category, version 1, empty summary, and null payload when no data is present.

Broker And Trigger Routing

With the routing feature, Broker evaluates Trigger filters and delivers matching events to sinks in parallel.

Trigger filters support AND logic across:

FilterMeaning
event_typeExact event type match.
sourceExact source match.
subject_patternSubject wildcard match with > and *.
attributesRequired metadata key/value pairs.

Routing is fire-and-forget. Delivery errors are logged and counted in the RouteResult, but they do not break the publisher's path.

Sinks

SinkUse case
TopicSinkRe-publish matched events to a provider.
InProcessSinkCall an async Rust handler directly.
LogSinkEmit matched events through tracing for debugging.
CollectorSinkCollect events in memory for tests.
FailingSinkExercise error paths in tests.

Dead Letter Queue

DLQ is application-level. Providers own retry and redelivery mechanics; A3S Event provides a unified way to represent and route events that permanently failed processing.

TypeBehavior
DeadLetterEventOriginal ReceivedEvent plus reason, timestamp, original subject, attempts, and first failure time.
MemoryDlqHandlerStores recent dead letters in memory.
SinkDlqHandlerWith routing, wraps dead letters as events and forwards them to a sink.
should_dead_letterHelper that checks num_delivered >= max_deliver.

Use DLQ for reprocessing, alerting, and audit; use provider-native retry/backoff for delivery mechanics.

On this page