A3S Docs
A3S Event

Operations

Feature flags, publish/subscribe options, metrics, and responsibility boundaries for A3S Event.

Event Operations

A3S Event is a library, not a standalone daemon. Operational behavior comes from the selected provider plus the optional application-level modules you enable.

Feature Flags

FeatureDefaultAdds
natsYesNATS JetStream provider.
encryptionYesAES-256-GCM payload encryptor and key rotation support.
cloudeventsYesCloudEvents v1.0 conversion.
routingYesBroker, Trigger, EventSink, and sink-backed DLQ.
fullNoEnables all optional feature modules.

Minimal core still includes event types, EventBus, memory provider, schema registry, DLQ abstraction, metrics, and custom provider traits.

Publish Options

PublishOptions exposes provider-native publishing controls. Providers that do not support an option may ignore it.

OptionMeaning
msg_idDeduplication id, mapped to NATS message id when supported.
expected_sequenceOptimistic concurrency guard.
timeout_secsPer-publish timeout override.

Subscribe Options

SubscribeOptions exposes provider-native consumer controls:

OptionMeaning
max_deliverMaximum delivery attempts before drop or DLQ handling.
backoff_secsRedelivery backoff intervals.
max_ack_pendingBackpressure cap for unacknowledged messages.
deliver_policyWhere a consumer starts: all, last, new, by sequence, by time, or last per subject.
ack_wait_secsRedelivery wait after an unacked message.

NATS maps these to JetStream consumer settings where available. MemoryProvider is lightweight and does not provide durable delivery semantics.

Metrics

EventMetrics uses lock-free atomic counters. EventBus::metrics() returns the live metrics object, and snapshot() gives a point-in-time view:

MetricMeaning
publish_count / publish_errorsSuccessful and failed publishes.
subscribe_count / unsubscribe_countSubscription lifecycle operations.
dlq_countEvents routed to DLQ.
validation_errorsSchema validation failures.
encrypt_count / decrypt_countPayload crypto operations.
avg_publish_latency_us / max_publish_latency_usPublish latency summary.

The crate does not expose a metrics server; scrape or export snapshots from the host application.

Responsibility Boundary

CapabilityOwner
Retry and backoffProvider-native consumer settings.
BackpressureProvider-native flow control and max_ack_pending.
Connection resilienceProvider client, such as async-nats reconnect behavior.
Partitioning or shardingProvider-native routing model.
Transport encryptionProvider configuration such as TLS.
Event versioning and schemaA3S Event.
Payload encryptionA3S Event, before publish and after receive.
Dead letter representation and routingA3S Event.
Subscription filter persistenceA3S Event state-store trait and host application.
Metrics and tracing hooksA3S Event plus host exporter.

This boundary is intentional: the crate avoids reimplementing the delivery mechanics that durable event providers already own.

Validation

Focused validation should run from crates/event, not the monorepo root:

cargo test --all-features
cargo test --no-default-features
cargo test --features nats

NATS integration tests require a JetStream-enabled NATS server.

On this page