Skip to main content

Crate faucet_source_nats

Crate faucet_source_nats 

Source
Expand description

§faucet-source-nats

A NATS source for faucet-stream. Subscribes to a subject (core NATS, with */> wildcards and optional queue groups) or pulls from a durable JetStream consumer, drains until max_messages or idle_timeout_secs fires, and yields each message payload as a JSON record (valid JSON passes through; anything else becomes a JSON string).

Core NATS is fire-and-forget (at-most-once: a message published while the source is not subscribed is never seen), so runs carry no bookmark and are not resumable. In JetStream mode each page’s messages are acked after the page is written, giving at-least-once delivery.

use faucet_source_nats::{NatsSource, NatsSourceConfig};
let source = NatsSource::new(NatsSourceConfig::new("events.>")).await?;

Re-exports§

pub use config::NatsOnDecodeError;
pub use config::NatsSourceConfig;
pub use config::NatsValueFormat;
pub use stream::NatsSource;

Modules§

config
Configuration for the NATS source.
stream
NatsSource — the NATS consumer implementation (the one module that does I/O).

Structs§

NatsConnectionConfig
Connection settings shared by the NATS source and sink.
NatsTls
Server verification and client-certificate settings for a connector that dials a TLS server itself (Redis, NATS, Elasticsearch).

Enums§

FaucetError
All possible errors returned by faucet-stream.
NatsAuth
NATS client authentication configuration.

Constants§

DESCRIPTOR
The connector’s static descriptor (RFC 0013): its capabilities, answered from config alone.

Traits§

Source
A source fetches records from an external system.