pub struct Kafka { /* private fields */ }
Implementations§
source§impl Kafka
impl Kafka
sourcepub fn connect(config: JsonValue) -> Self
pub fn connect(config: JsonValue) -> Self
链接
- config 配置
{
"default": "mac",
"connections": {
"mac": {
"brokers": [
"0.0.0.0:9092"
],
"fetch_max": 900000000,
"retry_max": 900000000
}
}
}
sourcepub fn add_config(&mut self, connection: JsonValue) -> &mut Self
pub fn add_config(&mut self, connection: JsonValue) -> &mut Self
增加配置
sourcepub fn switch_config(&mut self, default: &str) -> &mut Self
pub fn switch_config(&mut self, default: &str) -> &mut Self
切换配置