pub struct ConsumerConfig {Show 24 fields
pub bootstrap_servers: Vec<String>,
pub client_id: String,
pub group_id: String,
pub security_protocol: SecurityProtocol,
pub tls: TlsConfig,
pub sasl: SaslConfig,
pub request_timeout: Duration,
pub metadata_max_age: Duration,
pub retry_backoff: Duration,
pub max_retries: usize,
pub rebalance_timeout: Duration,
pub fetch_max_wait: Duration,
pub fetch_min_bytes: i32,
pub fetch_max_bytes: i32,
pub partition_max_bytes: i32,
pub auto_offset_reset: AutoOffsetReset,
pub isolation_level: IsolationLevel,
pub enable_auto_commit: bool,
pub auto_commit_interval: Duration,
pub server_assignor: Option<String>,
pub rack_id: Option<String>,
pub instance_id: Option<String>,
pub rebalance_listener: Option<ConsumerRebalanceListener>,
pub tcp_connector: Arc<dyn TcpConnector>,
}Expand description
Consumer Config.
Fields§
§bootstrap_servers: Vec<String>Bootstrap Servers.
client_id: StringClient Id.
group_id: StringGroup Id.
security_protocol: SecurityProtocolSecurity Protocol.
tls: TlsConfigTls.
sasl: SaslConfigSasl.
request_timeout: DurationRequest Timeout.
metadata_max_age: DurationMetadata Max Age.
retry_backoff: DurationRetry Backoff.
max_retries: usizeMax Retries.
rebalance_timeout: DurationRebalance Timeout.
fetch_max_wait: DurationFetch Max Wait.
fetch_min_bytes: i32Fetch Min Bytes.
fetch_max_bytes: i32Fetch Max Bytes.
partition_max_bytes: i32Partition Max Bytes.
auto_offset_reset: AutoOffsetResetAuto Offset Reset.
isolation_level: IsolationLevelIsolation Level.
enable_auto_commit: boolEnable Auto Commit.
auto_commit_interval: DurationAuto Commit Interval.
server_assignor: Option<String>Server Assignor.
rack_id: Option<String>Rack Id.
instance_id: Option<String>Instance Id.
rebalance_listener: Option<ConsumerRebalanceListener>Rebalance Listener.
tcp_connector: Arc<dyn TcpConnector>TCP connector.
Implementations§
Source§impl ConsumerConfig
impl ConsumerConfig
Sourcepub fn new(
bootstrap_server: impl Into<String>,
group_id: impl Into<String>,
) -> Self
pub fn new( bootstrap_server: impl Into<String>, group_id: impl Into<String>, ) -> Self
Creates a new value.
Sourcepub fn with_client_id(self, client_id: impl Into<String>) -> Self
pub fn with_client_id(self, client_id: impl Into<String>) -> Self
Sets client id and returns the updated value.
Sourcepub fn with_bootstrap_servers(
self,
servers: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn with_bootstrap_servers( self, servers: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Sets bootstrap servers and returns the updated value.
Sourcepub fn with_security_protocol(self, security_protocol: SecurityProtocol) -> Self
pub fn with_security_protocol(self, security_protocol: SecurityProtocol) -> Self
Sets security protocol and returns the updated value.
Sourcepub fn with_tls_ca_cert_path(self, path: impl Into<PathBuf>) -> Self
pub fn with_tls_ca_cert_path(self, path: impl Into<PathBuf>) -> Self
Sets tls ca cert path and returns the updated value.
Sourcepub fn with_tls_client_auth_paths(
self,
cert_path: impl Into<PathBuf>,
key_path: impl Into<PathBuf>,
) -> Self
pub fn with_tls_client_auth_paths( self, cert_path: impl Into<PathBuf>, key_path: impl Into<PathBuf>, ) -> Self
Sets tls client auth paths and returns the updated value.
Sourcepub fn with_tls_server_name(self, server_name: impl Into<String>) -> Self
pub fn with_tls_server_name(self, server_name: impl Into<String>) -> Self
Sets tls server name and returns the updated value.
Sourcepub fn with_sasl(self, sasl: SaslConfig) -> Self
pub fn with_sasl(self, sasl: SaslConfig) -> Self
Sets sasl and returns the updated value.
Sourcepub fn with_sasl_plain(
self,
username: impl Into<String>,
password: impl Into<String>,
) -> Self
pub fn with_sasl_plain( self, username: impl Into<String>, password: impl Into<String>, ) -> Self
Sets sasl plain and returns the updated value.
Sourcepub fn with_sasl_scram_sha_256(
self,
username: impl Into<String>,
password: impl Into<String>,
) -> Self
pub fn with_sasl_scram_sha_256( self, username: impl Into<String>, password: impl Into<String>, ) -> Self
Sets sasl scram sha 256 and returns the updated value.
Sourcepub fn with_sasl_scram_sha_512(
self,
username: impl Into<String>,
password: impl Into<String>,
) -> Self
pub fn with_sasl_scram_sha_512( self, username: impl Into<String>, password: impl Into<String>, ) -> Self
Sets sasl scram sha 512 and returns the updated value.
Sourcepub fn with_request_timeout(self, request_timeout: Duration) -> Self
pub fn with_request_timeout(self, request_timeout: Duration) -> Self
Sets request timeout and returns the updated value.
Sourcepub fn with_metadata_max_age(self, metadata_max_age: Duration) -> Self
pub fn with_metadata_max_age(self, metadata_max_age: Duration) -> Self
Sets metadata max age and returns the updated value.
Sourcepub fn with_retry_backoff(self, retry_backoff: Duration) -> Self
pub fn with_retry_backoff(self, retry_backoff: Duration) -> Self
Sets retry backoff and returns the updated value.
Sourcepub fn with_max_retries(self, max_retries: usize) -> Self
pub fn with_max_retries(self, max_retries: usize) -> Self
Sets max retries and returns the updated value.
Sourcepub fn with_rebalance_timeout(self, rebalance_timeout: Duration) -> Self
pub fn with_rebalance_timeout(self, rebalance_timeout: Duration) -> Self
Sets rebalance timeout and returns the updated value.
Sourcepub fn with_fetch_max_wait(self, fetch_max_wait: Duration) -> Self
pub fn with_fetch_max_wait(self, fetch_max_wait: Duration) -> Self
Sets fetch max wait and returns the updated value.
Sourcepub fn with_fetch_min_bytes(self, fetch_min_bytes: i32) -> Self
pub fn with_fetch_min_bytes(self, fetch_min_bytes: i32) -> Self
Sets fetch min bytes and returns the updated value.
Sourcepub fn with_fetch_max_bytes(self, fetch_max_bytes: i32) -> Self
pub fn with_fetch_max_bytes(self, fetch_max_bytes: i32) -> Self
Sets fetch max bytes and returns the updated value.
Sourcepub fn with_partition_max_bytes(self, partition_max_bytes: i32) -> Self
pub fn with_partition_max_bytes(self, partition_max_bytes: i32) -> Self
Sets partition max bytes and returns the updated value.
Sourcepub fn with_auto_offset_reset(self, auto_offset_reset: AutoOffsetReset) -> Self
pub fn with_auto_offset_reset(self, auto_offset_reset: AutoOffsetReset) -> Self
Sets auto offset reset and returns the updated value.
Sourcepub fn with_isolation_level(self, isolation_level: IsolationLevel) -> Self
pub fn with_isolation_level(self, isolation_level: IsolationLevel) -> Self
Sets isolation level and returns the updated value.
Sourcepub fn with_enable_auto_commit(self, enable_auto_commit: bool) -> Self
pub fn with_enable_auto_commit(self, enable_auto_commit: bool) -> Self
Sets enable auto commit and returns the updated value.
Sourcepub fn with_auto_commit_interval(self, auto_commit_interval: Duration) -> Self
pub fn with_auto_commit_interval(self, auto_commit_interval: Duration) -> Self
Sets auto commit interval and returns the updated value.
Sourcepub fn with_server_assignor(self, server_assignor: impl Into<String>) -> Self
pub fn with_server_assignor(self, server_assignor: impl Into<String>) -> Self
Sets server assignor and returns the updated value.
Sourcepub fn with_rack_id(self, rack_id: impl Into<String>) -> Self
pub fn with_rack_id(self, rack_id: impl Into<String>) -> Self
Sets rack id and returns the updated value.
Sourcepub fn with_instance_id(self, instance_id: impl Into<String>) -> Self
pub fn with_instance_id(self, instance_id: impl Into<String>) -> Self
Sets instance id and returns the updated value.
Sourcepub fn with_rebalance_listener(
self,
listener: ConsumerRebalanceListener,
) -> Self
pub fn with_rebalance_listener( self, listener: ConsumerRebalanceListener, ) -> Self
Sets rebalance listener and returns the updated value.
Sourcepub fn with_rebalance_callback(
self,
callback: impl Fn(ConsumerRebalanceEvent) + Send + Sync + 'static,
) -> Self
pub fn with_rebalance_callback( self, callback: impl Fn(ConsumerRebalanceEvent) + Send + Sync + 'static, ) -> Self
Sets rebalance callback and returns the updated value.
Sourcepub fn with_tcp_connector(self, tcp_connector: Arc<dyn TcpConnector>) -> Self
pub fn with_tcp_connector(self, tcp_connector: Arc<dyn TcpConnector>) -> Self
Sets TCP connector and returns the updated value.
Trait Implementations§
Source§impl Clone for ConsumerConfig
impl Clone for ConsumerConfig
Source§fn clone(&self) -> ConsumerConfig
fn clone(&self) -> ConsumerConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more