Struct rdkafka::consumer::stream_consumer::StreamConsumerContext [−][src]
pub struct StreamConsumerContext<C> where
C: ConsumerContext, { /* fields omitted */ }
Expand description
A consumer context wrapper for a stream consumer.
This context will automatically wake up the message stream when new data is available.
This type is not intended to be used directly. The construction of a
StreamConsumer
automatically wraps the underlying context in this type.
Implementations
Returns a reference to the inner ConsumerContext
used to create
this context.
Trait Implementations
impl<C, R> Consumer<StreamConsumerContext<C>> for StreamConsumer<C, R> where
C: ConsumerContext,
impl<C, R> Consumer<StreamConsumerContext<C>> for StreamConsumer<C, R> where
C: ConsumerContext,
Returns the Client
underlying this consumer.
Returns the current consumer group metadata associated with the consumer. Read more
Subscribes the consumer to a list of topics.
Unsubscribes the current subscription list.
Manually assigns topics and partitions to the consumer. If used, automatic consumer rebalance won’t be activated. Read more
Seeks to offset
for the specified topic
and partition
. After a
successful call to seek
, the next poll of the consumer will return the
message with offset
. Read more
fn commit(
&self,
topic_partition_list: &TopicPartitionList,
mode: CommitMode
) -> KafkaResult<()>
fn commit(
&self,
topic_partition_list: &TopicPartitionList,
mode: CommitMode
) -> KafkaResult<()>
Commits the offset of the specified message. The commit can be sync (blocking), or async. Notice that when a specific offset is committed, all the previous offsets are considered committed as well. Use this method only if you are processing messages in order. Read more
Commits the current consumer state. Notice that if the consumer fails after a message has been received, but before the message has been processed by the user code, this might lead to data loss. Check the “at-least-once delivery” section in the readme for more information. Read more
Commit the provided message. Note that this will also automatically commit every message with lower offset within the same partition. Read more
Stores offset to be used on the next (auto)commit. When
using this enable.auto.offset.store
should be set to false
in the
config. Read more
Like Consumer::store_offset
, but the offset to store is derived from
the provided message. Read more
Store offsets to be used on the next (auto)commit. When using this
enable.auto.offset.store
should be set to false
in the config. Read more
Returns the current topic subscription.
Returns the current partition assignment.
fn committed<T>(&self, timeout: T) -> KafkaResult<TopicPartitionList> where
T: Into<Timeout>,
Self: Sized,
fn committed<T>(&self, timeout: T) -> KafkaResult<TopicPartitionList> where
T: Into<Timeout>,
Self: Sized,
Retrieves the committed offsets for topics and partitions.
fn committed_offsets<T>(
&self,
tpl: TopicPartitionList,
timeout: T
) -> KafkaResult<TopicPartitionList> where
T: Into<Timeout>,
fn committed_offsets<T>(
&self,
tpl: TopicPartitionList,
timeout: T
) -> KafkaResult<TopicPartitionList> where
T: Into<Timeout>,
Retrieves the committed offsets for specified topics and partitions.
fn offsets_for_timestamp<T>(
&self,
timestamp: i64,
timeout: T
) -> KafkaResult<TopicPartitionList> where
T: Into<Timeout>,
Self: Sized,
fn offsets_for_timestamp<T>(
&self,
timestamp: i64,
timeout: T
) -> KafkaResult<TopicPartitionList> where
T: Into<Timeout>,
Self: Sized,
Looks up the offsets for this consumer’s partitions by timestamp.
fn offsets_for_times<T>(
&self,
timestamps: TopicPartitionList,
timeout: T
) -> KafkaResult<TopicPartitionList> where
T: Into<Timeout>,
Self: Sized,
fn offsets_for_times<T>(
&self,
timestamps: TopicPartitionList,
timeout: T
) -> KafkaResult<TopicPartitionList> where
T: Into<Timeout>,
Self: Sized,
Looks up the offsets for the specified partitions by timestamp.
Retrieve current positions (offsets) for topics and partitions.
fn fetch_metadata<T>(
&self,
topic: Option<&str>,
timeout: T
) -> KafkaResult<Metadata> where
T: Into<Timeout>,
Self: Sized,
fn fetch_metadata<T>(
&self,
topic: Option<&str>,
timeout: T
) -> KafkaResult<Metadata> where
T: Into<Timeout>,
Self: Sized,
Returns the metadata information for the specified topic, or for all topics in the cluster if no topic is specified. Read more
Returns the low and high watermarks for a specific topic and partition.
fn fetch_group_list<T>(
&self,
group: Option<&str>,
timeout: T
) -> KafkaResult<GroupList> where
T: Into<Timeout>,
Self: Sized,
fn fetch_group_list<T>(
&self,
group: Option<&str>,
timeout: T
) -> KafkaResult<GroupList> where
T: Into<Timeout>,
Self: Sized,
Returns the group membership information for the given group. If no group is specified, all groups will be returned. Read more
Pauses consumption for the provided list of partitions.
Resumes consumption for the provided list of partitions.
Reports the rebalance protocol in use.
Returns a reference to the ConsumerContext
used to create this
consumer. Read more
fn rebalance(
&self,
native_client: &NativeClient,
err: RDKafkaRespErr,
tpl: &mut TopicPartitionList
)
fn rebalance(
&self,
native_client: &NativeClient,
err: RDKafkaRespErr,
tpl: &mut TopicPartitionList
)
Implements the default rebalancing strategy and calls the
pre_rebalance
and
post_rebalance
methods. If this
method is overridden, it will be responsibility of the user to call them
if needed. Read more
Pre-rebalance callback. This method will run before the rebalance and should terminate its execution quickly. Read more
Post-rebalance callback. This method will run after the rebalance and should terminate its execution quickly. Read more
Post commit callback. This method will run after a group of offsets was committed to the offset store. Read more
Returns the minimum interval at which to poll the main queue, which services the logging, stats, and error callbacks. Read more
Message queue nonempty callback. This method will run when the consumer’s message queue switches from empty to nonempty. Read more