pub struct Builder<P = DefaultPartitioner> { /* private fields */ }
Expand description
A Kafka Producer builder easing the process of setting up various configuration settings.
Implementations§
source§impl Builder
impl Builder
sourcepub fn with_compression(self, compression: Compression) -> Self
pub fn with_compression(self, compression: Compression) -> Self
Sets the compression algorithm to use when sending out data.
See KafkaClient::set_compression
.
sourcepub fn with_ack_timeout(self, timeout: Duration) -> Self
pub fn with_ack_timeout(self, timeout: Duration) -> Self
Sets the maximum time the kafka brokers can await the receipt
of required acknowledgements (which is specified through
Builder::with_required_acks
.) Note that Kafka explicitly
documents this not to be a hard limit.
sourcepub fn with_connection_idle_timeout(self, timeout: Duration) -> Self
pub fn with_connection_idle_timeout(self, timeout: Duration) -> Self
Specifies the timeout for idle connections.
See KafkaClient::set_connection_idle_timeout
.
sourcepub fn with_required_acks(self, acks: RequiredAcks) -> Self
pub fn with_required_acks(self, acks: RequiredAcks) -> Self
Sets how many acknowledgements the kafka brokers should receive before responding to sent messages.
See RequiredAcks
.
sourcepub fn with_client_id(self, client_id: String) -> Self
pub fn with_client_id(self, client_id: String) -> Self
Specifies a client_id to be sent along every request to Kafka
brokers. See KafkaClient::set_client_id
.
source§impl<P> Builder<P>
impl<P> Builder<P>
sourcepub fn with_partitioner<Q: Partitioner>(self, partitioner: Q) -> Builder<Q>
pub fn with_partitioner<Q: Partitioner>(self, partitioner: Q) -> Builder<Q>
Sets the partitioner to dispatch when sending messages without an explicit partition assignment.