Struct fluvio::TopicProducerConfigBuilder
source · pub struct TopicProducerConfigBuilder { /* private fields */ }
Expand description
Builder for TopicProducerConfig
.
Implementations§
source§impl TopicProducerConfigBuilder
impl TopicProducerConfigBuilder
sourcepub fn batch_size(self, value: usize) -> Self
pub fn batch_size(self, value: usize) -> Self
Maximum amount of bytes accumulated by the records before sending the batch.
sourcepub fn batch_queue_size(self, value: usize) -> Self
pub fn batch_queue_size(self, value: usize) -> Self
Maximum amount of batches waiting in the queue before sending to the SPU.
sourcepub fn linger(self, value: Duration) -> Self
pub fn linger(self, value: Duration) -> Self
Time to wait before sending messages to the server.
sourcepub fn partitioner(self, value: Box<dyn Partitioner + Send + Sync>) -> Self
pub fn partitioner(self, value: Box<dyn Partitioner + Send + Sync>) -> Self
Partitioner assigns the partition to each record that needs to be send
sourcepub fn compression<VALUE: Into<Compression>>(self, value: VALUE) -> Self
pub fn compression<VALUE: Into<Compression>>(self, value: VALUE) -> Self
Compression algorithm used by Fluvio producer to compress data. If there is a topic level compression and it is not compatible with this setting, the producer initialization will fail.
sourcepub fn timeout(self, value: Duration) -> Self
pub fn timeout(self, value: Duration) -> Self
Max time duration that the server is allowed to process the batch.
sourcepub fn isolation(self, value: Isolation) -> Self
pub fn isolation(self, value: Isolation) -> Self
Isolation
level that the producer must respect.
Isolation::ReadCommitted
waits for messages to be committed (replicated) before
sending the response to the caller.
Isolation::ReadUncommitted
just waits for the leader to accept the message.
sourcepub fn delivery_semantic(self, value: DeliverySemantic) -> Self
pub fn delivery_semantic(self, value: DeliverySemantic) -> Self
Delivery guarantees that producer must respect.
DeliverySemantic::AtMostOnce
- send records without waiting from response. Fire and forget
approach.
DeliverySemantic::AtLeastOnce
- send records, wait for the response and retry
if error occurred. Retry parameters, such as delay, retry strategy, timeout, etc.,
can be configured in RetryPolicy
.