Skip to main content

ConsumerConfigBuilder

Struct ConsumerConfigBuilder 

Source
pub struct ConsumerConfigBuilder { /* private fields */ }
Expand description

Builder for ConsumerConfig.

Implementations§

Source§

impl ConsumerConfigBuilder

Source

pub fn new() -> Self

Source

pub fn bootstrap_server(self, server: impl Into<String>) -> Self

Set a single bootstrap server (convenience for bootstrap_servers).

Source

pub fn bootstrap_servers(self, servers: Vec<String>) -> Self

Set multiple bootstrap servers for failover.

Source

pub fn group_id(self, group: impl Into<String>) -> Self

Source

pub fn topics(self, topics: Vec<String>) -> Self

Source

pub fn topic(self, topic: impl Into<String>) -> Self

Source

pub fn assign(self, topic: impl Into<String>, partitions: Vec<u32>) -> Self

Assign specific partitions for a topic (static assignment).

Source

pub fn max_poll_records(self, n: u32) -> Self

Source

pub fn max_poll_interval_ms(self, ms: u64) -> Self

Source

pub fn auto_commit_interval(self, interval: Option<Duration>) -> Self

Source

pub fn enable_auto_commit(self, enabled: bool) -> Self

Source

pub fn isolation_level(self, level: u8) -> Self

Source

pub fn read_committed(self) -> Self

Use read_committed isolation (only see committed transactional messages).

Source

pub fn auth( self, username: impl Into<String>, password: impl Into<String>, ) -> Self

Source

pub fn metadata_refresh_interval(self, interval: Duration) -> Self

Set the interval for periodic partition re-discovery.

Source

pub fn reconnect_backoff_ms(self, ms: u64) -> Self

Set initial reconnect backoff delay in milliseconds.

Source

pub fn reconnect_backoff_max_ms(self, ms: u64) -> Self

Set maximum reconnect backoff delay in milliseconds.

Source

pub fn max_reconnect_attempts(self, attempts: u32) -> Self

Set maximum number of reconnect attempts (default: 10).

Source

pub fn session_timeout_ms(self, ms: u32) -> Self

Set session timeout for group coordination (default: 10 000 ms).

Source

pub fn rebalance_timeout_ms(self, ms: u32) -> Self

Set rebalance timeout (default: 30 000 ms).

Source

pub fn heartbeat_interval_ms(self, ms: u64) -> Self

Set heartbeat interval (default: 3 000 ms, should be ≤ 1/3 of session timeout).

Source

pub fn build(self) -> ConsumerConfig

Trait Implementations§

Source§

impl Default for ConsumerConfigBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more