Skip to main content

ruststream_pulsar/
lib.rs

1//! Apache Pulsar broker implementation for `RustStream`.
2//!
3//! Handlers, routers, codecs, and middleware come from the framework; this crate supplies the
4//! transport over the [`pulsar`](https://docs.rs/pulsar) client maintained by `StreamNative`.
5//!
6//! - Four subscription types as an enum with per-variant meaning (exclusive, shared, failover,
7//!   key-shared) - combinations that do not exist are unrepresentable.
8//! - The consumer-side dead-letter policy carries its delivery-attempt limit, and the ack
9//!   timeout redelivers automatically; both are product features, not crate machinery.
10//! - [`PulsarTopic`] validates the four meanings a topic name carries (persistence, tenant,
11//!   namespace, topic) on construction instead of at first use.
12//! - Multi-topic and pattern subscriptions are descriptor variants.
13//! - Key sharing maps onto the partition key; message properties carry headers directly, so no
14//!   envelope format is invented.
15//!
16//! Transactions, consumer-side batch receive, and the schema registry are deliberately out of
17//! scope: the client does not implement them, and the capability traits they would back are
18//! optional by design.
19
20#![forbid(unsafe_code)]
21
22mod broker;
23mod error;
24mod message;
25mod publisher;
26mod subscriber;
27mod subscription;
28#[cfg(feature = "testing")]
29pub mod testing;
30mod topic;
31
32pub use broker::{ConnectedPulsarBroker, PulsarBroker};
33pub use error::PulsarError;
34pub use message::{PARTITION_KEY_HEADER, PulsarMessage, PulsarPosition};
35pub use publisher::{PulsarPublish, PulsarPublisher};
36pub use subscriber::{PulsarSeeker, PulsarSubscriber};
37pub use subscription::{DeadLetter, PulsarSubscription, SubscriptionType};
38pub use topic::PulsarTopic;