Struct kafka::producer::Builder
[−]
[src]
pub struct Builder<P = DefaultPartitioner> { /* fields omitted */ }
A Kafka Producer builder easing the process of setting up various configuration settings.
Methods
impl Builder
[src]
fn with_security(self, security: SecurityConfig) -> Self
[src]
Specifies the security config to use.
See KafkaClient::new_secure
for more info.
fn with_compression(self, compression: Compression) -> Self
[src]
Sets the compression algorithm to use when sending out data.
See KafkaClient::set_compression
.
fn with_ack_timeout(self, timeout: Duration) -> Self
[src]
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 explicitely
documents this not to be a hard limit.
fn with_connection_idle_timeout(self, timeout: Duration) -> Self
[src]
Specifies the timeout for idle connections.
See KafkaClient::set_connection_idle_timeout
.
fn with_required_acks(self, acks: RequiredAcks) -> Self
[src]
Sets how many acknowledgements the kafka brokers should receive before responding to sent messages.
See RequiredAcks
.
fn with_client_id(self, client_id: String) -> Self
[src]
Specifies a client_id to be sent along every request to Kafka
brokers. See KafkaClient::set_client_id
.
impl<P> Builder<P>
[src]
fn with_partitioner<Q: Partitioner>(self, partitioner: Q) -> Builder<Q>
[src]
Sets the partitioner to dispatch when sending messages without an explicit partition assignment.
fn create(self) -> Result<Producer<P>>
[src]
Finally creates/builds a new producer based on the so far supplied settings.