nav.groups.config

Queue Publishers

External event publishing through NATS or Redis Streams.

Queue Publishers

External event publishing.

The queue module provides the EventPublisher trait and two feature-gated implementations for publishing AgentEvent values to external message brokers.

EventPublisher trait

#[async_trait]
pub trait EventPublisher: Send + Sync {
    async fn publish(&self, event: &AgentEvent) -> Result<(), QueueError>;
    async fn health_check(&self) -> Result<(), QueueError>;
}

Backends

BackendFeatureMechanism
NATSnats + queueNATS JetStream publish per run
Redis Streamsredis + queueXADD per run stream
No-opqueue (core)Discards events (for testing)

How it works

A tokio::spawn task enqueues a PublishToQueue job after each event is persisted. The publisher receives the event and pushes it to the configured broker. Failures are logged and counted; the run loop does not block on publish failures.

When to use

  • Fan-out observability to external systems.
  • Triggering downstream workflows on run completion.
  • Cross-instance event synchronisation.

See also

Related components

Edit this page on GitHub →