pub struct KafkaConfig {
pub url: String,
pub topic: Option<String>,
pub username: Option<String>,
pub password: Option<String>,
pub tls: TlsConfig,
pub group_id: Option<String>,
pub delayed_ack: bool,
pub producer_options: Option<Vec<(String, String)>>,
pub consumer_options: Option<Vec<(String, String)>>,
}Expand description
General Kafka connection configuration.
Fields§
§url: StringComma-separated list of Kafka broker URLs.
topic: Option<String>The Kafka topic to produce to or consume from.
username: Option<String>Optional username for SASL authentication.
password: Option<String>Optional password for SASL authentication.
tls: TlsConfigTLS configuration.
group_id: Option<String>(Consumer only) Consumer group ID. If not provided, the consumer acts in Subscriber mode: it generates a unique, ephemeral group ID and starts consuming from the latest offset.
delayed_ack: bool(Publisher only) If true, do not wait for an acknowledgement when sending to broker. Defaults to false.
producer_options: Option<Vec<(String, String)>>(Publisher only) Additional librdkafka producer configuration options (key-value pairs).
consumer_options: Option<Vec<(String, String)>>(Consumer only) Additional librdkafka consumer configuration options (key-value pairs).
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 moreSource§impl Debug for KafkaConfig
impl Debug for KafkaConfig
Source§impl Default for KafkaConfig
impl Default for KafkaConfig
Source§fn default() -> KafkaConfig
fn default() -> KafkaConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for KafkaConfig
impl<'de> Deserialize<'de> for KafkaConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for KafkaConfig
impl RefUnwindSafe for KafkaConfig
impl Send for KafkaConfig
impl Sync for KafkaConfig
impl Unpin 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