pub struct KafkaConfig {
pub brokers: String,
pub default_topic: String,
pub client_id: String,
pub acks: String,
pub timeout_ms: u64,
pub compression: Option<String>,
}Expand description
Kafka transport adapter configuration.
Fields§
§brokers: StringKafka broker addresses (comma-separated).
default_topic: StringDefault topic for events (can be overridden per subscription).
client_id: StringClient ID for Kafka producer.
acks: StringMessage acknowledgment mode (“all”, “1”, “0”).
timeout_ms: u64Message timeout in milliseconds.
compression: Option<String>Enable message compression.
Implementations§
Source§impl KafkaConfig
impl KafkaConfig
Sourcepub fn new(brokers: impl Into<String>, default_topic: impl Into<String>) -> Self
pub fn new(brokers: impl Into<String>, default_topic: impl Into<String>) -> Self
Create a new Kafka configuration.
Sourcepub fn with_client_id(self, client_id: impl Into<String>) -> Self
pub fn with_client_id(self, client_id: impl Into<String>) -> Self
Set the client ID.
Sourcepub fn with_timeout(self, timeout_ms: u64) -> Self
pub fn with_timeout(self, timeout_ms: u64) -> Self
Set message timeout.
Sourcepub fn with_compression(self, compression: impl Into<String>) -> Self
pub fn with_compression(self, compression: impl Into<String>) -> Self
Enable compression (e.g., “gzip”, “snappy”, “lz4”).
Trait Implementations§
Source§impl Clone for KafkaConfig
impl Clone for KafkaConfig
Source§fn clone(&self) -> KafkaConfig
fn clone(&self) -> KafkaConfig
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 moreAuto Trait Implementations§
impl Freeze for KafkaConfig
impl RefUnwindSafe for KafkaConfig
impl Send for KafkaConfig
impl Sync for KafkaConfig
impl Unpin for KafkaConfig
impl UnsafeUnpin for KafkaConfig
impl UnwindSafe for KafkaConfig
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