faucet_sink_pubsub/lib.rs
1#![cfg_attr(docsrs, feature(doc_cfg))]
2
3//! # faucet-sink-pubsub
4//!
5//! Google Cloud Pub/Sub sink connector for
6//! [faucet-stream](https://github.com/faucet-hq/faucet-stream): batched
7//! `publish` to a topic with a configurable `value_format` (json / string /
8//! bytes), optional per-message `ordering_key` (field or dot-path) that
9//! enables message ordering, bounded publish concurrency, and per-message
10//! partial-failure outcomes that route to a DLQ.
11//!
12//! **Delivery is at-least-once** — Pub/Sub provides no primitive that composes
13//! with faucet's exactly-once watermark model, so this sink does not advertise
14//! idempotent writes. De-duplicate downstream on a business key carried in
15//! the payload or an attribute — the server assigns a fresh `message_id` to
16//! every publish, so a re-sent record never shares its id.
17
18mod config;
19mod encode;
20mod sink;
21
22pub use config::{MAX_BATCH, OrderingKey, PubsubSinkConfig, ValueFormat};
23pub use sink::PubsubSink;
24
25// Shared connection types, re-exported so users need only this crate.
26pub use faucet_common_pubsub::{PubsubConnection, PubsubCredentials};
27
28/// The connector's static descriptor (RFC 0013): its capabilities, answered from config alone.
29pub const DESCRIPTOR: faucet_core::ConnectorDescriptor =
30 faucet_core::ConnectorDescriptor::new("pubsub", faucet_core::capabilities::append_only_sink)
31 .with_host_identity(faucet_common_pubsub::host_identity);