Struct sea_streamer_kafka::KafkaProducer
source · pub struct KafkaProducer { /* private fields */ }
Implementations§
source§impl KafkaProducer
impl KafkaProducer
sourcepub fn send_record<K, P>(
&self,
record: FutureRecord<'_, K, P>
) -> KafkaResult<SendFuture>
pub fn send_record<K, P>( &self, record: FutureRecord<'_, K, P> ) -> KafkaResult<SendFuture>
Send a raw FutureRecord
to a stream
sourcepub fn send_message<S: Buffer>(
&self,
header: MessageHeader,
payload: S
) -> KafkaResult<SendFuture>
pub fn send_message<S: Buffer>( &self, header: MessageHeader, payload: S ) -> KafkaResult<SendFuture>
Send a message to a particular (topic, partition).
The timestamp
and sequence
of MessageHeader
is currently ignored.
sourcepub fn in_flight_count(&self) -> i32
pub fn in_flight_count(&self) -> i32
Returns the number of messages that are either waiting to be sent or are sent but are waiting to be acknowledged.
sourcepub async fn init_transactions(&mut self) -> KafkaResult<()>
pub async fn init_transactions(&mut self) -> KafkaResult<()>
See https://docs.rs/rdkafka/latest/rdkafka/producer/trait.Producer.html#tymethod.init_transactions
§Warning
This async method is not cancel safe. You must await this future, and this Producer will be unusable for any operations until it finishes.
sourcepub async fn begin_transaction(&mut self) -> KafkaResult<()>
pub async fn begin_transaction(&mut self) -> KafkaResult<()>
See https://docs.rs/rdkafka/latest/rdkafka/producer/trait.Producer.html#tymethod.begin_transaction
§Warning
This async method is not cancel safe. You must await this future, and this Producer will be unusable for any operations until it finishes.
sourcepub async fn commit_transaction(&mut self) -> KafkaResult<()>
pub async fn commit_transaction(&mut self) -> KafkaResult<()>
See https://docs.rs/rdkafka/latest/rdkafka/producer/trait.Producer.html#tymethod.commit_transaction
§Warning
This async method is not cancel safe. You must await this future, and this Producer will be unusable for any operations until it finishes.
sourcepub async fn abort_transaction(&mut self) -> KafkaResult<()>
pub async fn abort_transaction(&mut self) -> KafkaResult<()>
See https://docs.rs/rdkafka/latest/rdkafka/producer/trait.Producer.html#tymethod.abort_transaction
§Warning
This async method is not cancel safe. You must await this future, and this Producer will be unusable for any operations until it finishes.
sourcepub async fn send_offsets_to_transaction(
&mut self,
offsets: TopicPartitionList,
cgm: ConsumerGroupMetadata
) -> KafkaResult<()>
pub async fn send_offsets_to_transaction( &mut self, offsets: TopicPartitionList, cgm: ConsumerGroupMetadata ) -> KafkaResult<()>
§Warning
This async method is not cancel safe. You must await this future, and this Producer will be unusable for any operations until it finishes.
sourcepub async fn flush_with_timeout(&mut self, timeout: Duration) -> KafkaResult<()>
pub async fn flush_with_timeout(&mut self, timeout: Duration) -> KafkaResult<()>
Flush pending messages with a timeout.
§Warning
This async method is not cancel safe. You must await this future, and this Producer will be unusable for any operations until it finishes.
Trait Implementations§
source§impl Clone for KafkaProducer
impl Clone for KafkaProducer
source§fn clone(&self) -> KafkaProducer
fn clone(&self) -> KafkaProducer
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for KafkaProducer
impl Debug for KafkaProducer
source§impl Producer for KafkaProducer
impl Producer for KafkaProducer
type Error = KafkaError
type SendFuture = SendFuture
source§fn send_to<S: Buffer>(
&self,
stream: &StreamKey,
payload: S
) -> KafkaResult<Self::SendFuture>
fn send_to<S: Buffer>( &self, stream: &StreamKey, payload: S ) -> KafkaResult<Self::SendFuture>
source§async fn end(self) -> KafkaResult<()>
async fn end(self) -> KafkaResult<()>
source§async fn flush(&mut self) -> KafkaResult<()>
async fn flush(&mut self) -> KafkaResult<()>
source§fn anchor(&mut self, stream: StreamKey) -> KafkaResult<()>
fn anchor(&mut self, stream: StreamKey) -> KafkaResult<()>
StreamErr::AlreadyAnchored
error.source§fn anchored(&self) -> KafkaResult<&StreamKey>
fn anchored(&self) -> KafkaResult<&StreamKey>
StreamErr::NotAnchored
error.