Skip to main content

connxt_kafka/
lib.rs

1//! A small, safe Kafka client built directly on Kafka's TCP protocol.
2//!
3//! The synchronous client is available by default. Enable `async` for the
4//! Tokio transport. Kafka client/protocol crates are intentionally not used.
5
6pub mod auth;
7mod broker;
8mod client;
9mod connection;
10mod consumer;
11mod error;
12mod group;
13mod producer;
14pub mod protocol;
15mod tls;
16
17#[cfg(feature = "async")]
18pub mod async_client;
19#[cfg(feature = "async")]
20pub use async_client::{
21    AsyncClient, AsyncConsumer, AsyncGroupLoader, AsyncGroupSession, AsyncLoader, AsyncProducer,
22    AsyncProducerBuilder,
23};
24
25pub use client::{
26    Client, ClientBuilder, ClientOptions, ConfigEntry, ConfigResource, GroupDescription,
27    GroupMember, GroupSummary, Metadata, PartitionMetadata,
28};
29pub use consumer::{
30    Consumer, FetchRecord, FetchResult, GroupLoader, LoadedBatch, Loader, LoaderBuilder,
31};
32pub use error::{Error, Result};
33pub use group::GroupSession;
34pub use producer::{Compression, Delivery, Producer, ProducerBuilder, Record, partition_for_key};
35
36/// Connxt's small Kafka entry point.
37pub struct Driver;
38impl Driver {
39    pub fn connect(url: &str) -> Result<Client> {
40        ClientBuilder::new(url)?.build()
41    }
42}