pub struct KafkaClientConfig(/* private fields */);Expand description
A wrapper around rdkafka::ClientConfig for convenience.
Provides recommended config with KafkaClientConfig::new_recommended which is configured for
at-least-once kafka semantic. Offsets should be manually added to the store.
For more info, see the rust-rdkafka/examples/at_least_once.rs example.
Implementations§
Source§impl KafkaClientConfig
impl KafkaClientConfig
Sourcepub fn new(config: ClientConfig) -> Self
pub fn new(config: ClientConfig) -> Self
Create a new KafkaClientConfig from an existing rdkafka::ClientConfig.
Sourcepub fn new_recommended(
group_id: impl Into<String>,
brokers: impl Into<String>,
) -> Self
pub fn new_recommended( group_id: impl Into<String>, brokers: impl Into<String>, ) -> Self
Create a new KafkaClientConfig with a recommended configuration with at-least-once semantics.
Along with group.id and bootstrap.servers, the following config items are set:
enable.partition.eof=falsesession.timeout.ms=6000enable.auto.commit=trueauto.commit.interval.ms=5000enable.auto.offset.store=false
Sourcepub fn into_inner(self) -> ClientConfig
pub fn into_inner(self) -> ClientConfig
Return the inner rdkafka::ClientConfig.
Trait Implementations§
Source§impl AsMut<ClientConfig> for KafkaClientConfig
impl AsMut<ClientConfig> for KafkaClientConfig
Source§fn as_mut(&mut self) -> &mut ClientConfig
fn as_mut(&mut self) -> &mut ClientConfig
Converts this type into a mutable reference of the (usually inferred) input type.
Source§impl AsRef<ClientConfig> for KafkaClientConfig
impl AsRef<ClientConfig> for KafkaClientConfig
Source§fn as_ref(&self) -> &ClientConfig
fn as_ref(&self) -> &ClientConfig
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl Clone for KafkaClientConfig
impl Clone for KafkaClientConfig
Source§fn clone(&self) -> KafkaClientConfig
fn clone(&self) -> KafkaClientConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KafkaClientConfig
impl Debug for KafkaClientConfig
Source§impl From<KafkaClientConfig> for ClientConfig
impl From<KafkaClientConfig> for ClientConfig
Source§fn from(config: KafkaClientConfig) -> Self
fn from(config: KafkaClientConfig) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for KafkaClientConfig
impl RefUnwindSafe for KafkaClientConfig
impl Send for KafkaClientConfig
impl Sync for KafkaClientConfig
impl Unpin for KafkaClientConfig
impl UnwindSafe for KafkaClientConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more