pub struct ProducerConfig {Show 24 fields
pub bootstrap_servers: Vec<String>,
pub client_id: String,
pub security_protocol: SecurityProtocol,
pub tls: TlsConfig,
pub sasl: SaslConfig,
pub acks: i16,
pub enable_idempotence: bool,
pub partitioner: ProducerPartitioner,
pub compression: ProducerCompression,
pub batch_size: usize,
pub buffer_memory: usize,
pub max_block: Duration,
pub max_request_size: usize,
pub partitioner_ignore_keys: bool,
pub linger: Duration,
pub delivery_timeout: Duration,
pub request_timeout: Duration,
pub metadata_max_age: Duration,
pub retry_backoff: Duration,
pub max_retries: usize,
pub max_in_flight_requests_per_connection: usize,
pub transactional_id: Option<String>,
pub transaction_timeout: Duration,
pub tcp_connector: Arc<dyn TcpConnector>,
}Expand description
Producer Config.
Fields§
§bootstrap_servers: Vec<String>Bootstrap Servers.
client_id: StringClient Id.
security_protocol: SecurityProtocolSecurity Protocol.
tls: TlsConfigTls.
sasl: SaslConfigSasl.
acks: i16Acks.
enable_idempotence: boolEnable Idempotence.
partitioner: ProducerPartitionerPartitioner.
compression: ProducerCompressionCompression.
batch_size: usizeBatch Size.
buffer_memory: usizeTotal memory available to buffered producer records.
max_block: DurationMaximum time producer calls may wait for metadata or buffer capacity.
max_request_size: usizeMaximum serialized Produce request size.
partitioner_ignore_keys: boolWhether the default partitioner should ignore record keys.
linger: DurationLinger.
delivery_timeout: DurationDelivery Timeout.
request_timeout: DurationRequest Timeout.
metadata_max_age: DurationMetadata Max Age.
retry_backoff: DurationRetry Backoff.
max_retries: usizeMax Retries.
max_in_flight_requests_per_connection: usizeMax In Flight Requests Per Connection.
transactional_id: Option<String>Transactional Id.
transaction_timeout: DurationTransaction Timeout.
tcp_connector: Arc<dyn TcpConnector>TCP connector.
Implementations§
Source§impl ProducerConfig
impl ProducerConfig
Sourcepub fn with_client_id(self, client_id: impl Into<String>) -> Self
pub fn with_client_id(self, client_id: impl Into<String>) -> Self
Sets client id and returns the updated value.
Sourcepub fn with_bootstrap_servers(
self,
servers: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn with_bootstrap_servers( self, servers: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Sets bootstrap servers and returns the updated value.
Sourcepub fn with_security_protocol(self, security_protocol: SecurityProtocol) -> Self
pub fn with_security_protocol(self, security_protocol: SecurityProtocol) -> Self
Sets security protocol and returns the updated value.
Sourcepub fn with_tls_ca_cert_path(self, path: impl Into<PathBuf>) -> Self
pub fn with_tls_ca_cert_path(self, path: impl Into<PathBuf>) -> Self
Sets tls ca cert path and returns the updated value.
Sourcepub fn with_tls_client_auth_paths(
self,
cert_path: impl Into<PathBuf>,
key_path: impl Into<PathBuf>,
) -> Self
pub fn with_tls_client_auth_paths( self, cert_path: impl Into<PathBuf>, key_path: impl Into<PathBuf>, ) -> Self
Sets tls client auth paths and returns the updated value.
Sourcepub fn with_tls_server_name(self, server_name: impl Into<String>) -> Self
pub fn with_tls_server_name(self, server_name: impl Into<String>) -> Self
Sets tls server name and returns the updated value.
Sourcepub fn with_sasl(self, sasl: SaslConfig) -> Self
pub fn with_sasl(self, sasl: SaslConfig) -> Self
Sets sasl and returns the updated value.
Sourcepub fn with_sasl_plain(
self,
username: impl Into<String>,
password: impl Into<String>,
) -> Self
pub fn with_sasl_plain( self, username: impl Into<String>, password: impl Into<String>, ) -> Self
Sets sasl plain and returns the updated value.
Sourcepub fn with_sasl_scram_sha_256(
self,
username: impl Into<String>,
password: impl Into<String>,
) -> Self
pub fn with_sasl_scram_sha_256( self, username: impl Into<String>, password: impl Into<String>, ) -> Self
Sets sasl scram sha 256 and returns the updated value.
Sourcepub fn with_sasl_scram_sha_512(
self,
username: impl Into<String>,
password: impl Into<String>,
) -> Self
pub fn with_sasl_scram_sha_512( self, username: impl Into<String>, password: impl Into<String>, ) -> Self
Sets sasl scram sha 512 and returns the updated value.
Sourcepub fn with_enable_idempotence(self, enable_idempotence: bool) -> Self
pub fn with_enable_idempotence(self, enable_idempotence: bool) -> Self
Sets enable idempotence and returns the updated value.
Sourcepub fn with_partitioner(self, partitioner: ProducerPartitioner) -> Self
pub fn with_partitioner(self, partitioner: ProducerPartitioner) -> Self
Sets partitioner and returns the updated value.
Sourcepub fn with_compression(self, compression: ProducerCompression) -> Self
pub fn with_compression(self, compression: ProducerCompression) -> Self
Sets compression and returns the updated value.
Sourcepub fn with_batch_size(self, batch_size: usize) -> Self
pub fn with_batch_size(self, batch_size: usize) -> Self
Sets batch size and returns the updated value.
Sourcepub fn with_buffer_memory(self, buffer_memory: usize) -> Self
pub fn with_buffer_memory(self, buffer_memory: usize) -> Self
Sets total memory available to buffered records and returns the updated value.
Sourcepub fn with_max_block(self, max_block: Duration) -> Self
pub fn with_max_block(self, max_block: Duration) -> Self
Sets the maximum time producer calls may wait for metadata or buffer capacity.
Sourcepub fn with_max_request_size(self, max_request_size: usize) -> Self
pub fn with_max_request_size(self, max_request_size: usize) -> Self
Sets maximum serialized Produce request size and returns the updated value.
Sourcepub fn with_partitioner_ignore_keys(self, ignore_keys: bool) -> Self
pub fn with_partitioner_ignore_keys(self, ignore_keys: bool) -> Self
Sets whether the default partitioner ignores record keys.
Sourcepub fn with_linger(self, linger: Duration) -> Self
pub fn with_linger(self, linger: Duration) -> Self
Sets linger and returns the updated value.
Sourcepub fn with_delivery_timeout(self, delivery_timeout: Duration) -> Self
pub fn with_delivery_timeout(self, delivery_timeout: Duration) -> Self
Sets delivery timeout and returns the updated value.
Sourcepub fn with_request_timeout(self, request_timeout: Duration) -> Self
pub fn with_request_timeout(self, request_timeout: Duration) -> Self
Sets request timeout and returns the updated value.
Sourcepub fn with_metadata_max_age(self, metadata_max_age: Duration) -> Self
pub fn with_metadata_max_age(self, metadata_max_age: Duration) -> Self
Sets metadata max age and returns the updated value.
Sourcepub fn with_retry_backoff(self, retry_backoff: Duration) -> Self
pub fn with_retry_backoff(self, retry_backoff: Duration) -> Self
Sets retry backoff and returns the updated value.
Sourcepub fn with_max_retries(self, max_retries: usize) -> Self
pub fn with_max_retries(self, max_retries: usize) -> Self
Sets max retries and returns the updated value.
Sourcepub fn with_max_in_flight_requests_per_connection(
self,
max_in_flight: usize,
) -> Self
pub fn with_max_in_flight_requests_per_connection( self, max_in_flight: usize, ) -> Self
Sets max in-flight requests per broker connection and returns the updated value.
Sourcepub fn with_transactional_id(self, transactional_id: impl Into<String>) -> Self
pub fn with_transactional_id(self, transactional_id: impl Into<String>) -> Self
Sets transactional id and returns the updated value.
Sourcepub fn with_transaction_timeout(self, transaction_timeout: Duration) -> Self
pub fn with_transaction_timeout(self, transaction_timeout: Duration) -> Self
Sets transaction timeout and returns the updated value.
Sourcepub fn with_tcp_connector(self, tcp_connector: Arc<dyn TcpConnector>) -> Self
pub fn with_tcp_connector(self, tcp_connector: Arc<dyn TcpConnector>) -> Self
Sets TCP connector and returns the updated value.
Sourcepub fn is_transactional(&self) -> bool
pub fn is_transactional(&self) -> bool
Returns whether transactional.
Sourcepub fn is_idempotent(&self) -> bool
pub fn is_idempotent(&self) -> bool
Returns whether idempotent.
Trait Implementations§
Source§impl Clone for ProducerConfig
impl Clone for ProducerConfig
Source§fn clone(&self) -> ProducerConfig
fn clone(&self) -> ProducerConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more