pub struct ConsumerConfigBuilder { /* private fields */ }Expand description
Builder for ConsumerConfig.
Implementations§
Source§impl ConsumerConfigBuilder
impl ConsumerConfigBuilder
pub fn new() -> Self
Sourcepub fn bootstrap_server(self, server: impl Into<String>) -> Self
pub fn bootstrap_server(self, server: impl Into<String>) -> Self
Set a single bootstrap server (convenience for bootstrap_servers).
Sourcepub fn bootstrap_servers(self, servers: Vec<String>) -> Self
pub fn bootstrap_servers(self, servers: Vec<String>) -> Self
Set multiple bootstrap servers for failover.
pub fn group_id(self, group: impl Into<String>) -> Self
pub fn topics(self, topics: Vec<String>) -> Self
pub fn topic(self, topic: impl Into<String>) -> Self
Sourcepub fn assign(self, topic: impl Into<String>, partitions: Vec<u32>) -> Self
pub fn assign(self, topic: impl Into<String>, partitions: Vec<u32>) -> Self
Assign specific partitions for a topic (static assignment).
pub fn max_poll_records(self, n: u32) -> Self
pub fn max_poll_interval_ms(self, ms: u64) -> Self
pub fn auto_commit_interval(self, interval: Option<Duration>) -> Self
pub fn enable_auto_commit(self, enabled: bool) -> Self
pub fn isolation_level(self, level: u8) -> Self
Sourcepub fn read_committed(self) -> Self
pub fn read_committed(self) -> Self
Use read_committed isolation (only see committed transactional messages).
pub fn auth( self, username: impl Into<String>, password: impl Into<String>, ) -> Self
Sourcepub fn metadata_refresh_interval(self, interval: Duration) -> Self
pub fn metadata_refresh_interval(self, interval: Duration) -> Self
Set the interval for periodic partition re-discovery.
Sourcepub fn reconnect_backoff_ms(self, ms: u64) -> Self
pub fn reconnect_backoff_ms(self, ms: u64) -> Self
Set initial reconnect backoff delay in milliseconds.
Sourcepub fn reconnect_backoff_max_ms(self, ms: u64) -> Self
pub fn reconnect_backoff_max_ms(self, ms: u64) -> Self
Set maximum reconnect backoff delay in milliseconds.
Sourcepub fn max_reconnect_attempts(self, attempts: u32) -> Self
pub fn max_reconnect_attempts(self, attempts: u32) -> Self
Set maximum number of reconnect attempts (default: 10).
Sourcepub fn session_timeout_ms(self, ms: u32) -> Self
pub fn session_timeout_ms(self, ms: u32) -> Self
Set session timeout for group coordination (default: 10 000 ms).
Sourcepub fn rebalance_timeout_ms(self, ms: u32) -> Self
pub fn rebalance_timeout_ms(self, ms: u32) -> Self
Set rebalance timeout (default: 30 000 ms).
Sourcepub fn heartbeat_interval_ms(self, ms: u64) -> Self
pub fn heartbeat_interval_ms(self, ms: u64) -> Self
Set heartbeat interval (default: 3 000 ms, should be ≤ 1/3 of session timeout).
pub fn build(self) -> ConsumerConfig
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConsumerConfigBuilder
impl RefUnwindSafe for ConsumerConfigBuilder
impl Send for ConsumerConfigBuilder
impl Sync for ConsumerConfigBuilder
impl Unpin for ConsumerConfigBuilder
impl UnsafeUnpin for ConsumerConfigBuilder
impl UnwindSafe for ConsumerConfigBuilder
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