Trait rdkafka::consumer::ConsumerContext
[−]
[src]
pub trait ConsumerContext: ClientContext { fn rebalance(
&self,
native_client: &NativeClient,
err: RDKafkaRespErr,
tpl: &TopicPartitionList
) { ... } fn pre_rebalance<'a>(&self, rebalance: &Rebalance<'a>) { ... } fn post_rebalance<'a>(&self, rebalance: &Rebalance<'a>) { ... } fn commit_callback(
&self,
result: KafkaResult<()>,
offsets: *mut RDKafkaTopicPartitionList
) { ... } }
Consumer specific Context. This user-defined object can be used to provide custom callbacks to consumer events. Refer to the list of methods to check which callbacks can be specified.
Provided Methods
fn rebalance(
&self,
native_client: &NativeClient,
err: RDKafkaRespErr,
tpl: &TopicPartitionList
)
&self,
native_client: &NativeClient,
err: RDKafkaRespErr,
tpl: &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.
fn pre_rebalance<'a>(&self, rebalance: &Rebalance<'a>)
Pre-rebalance callback. This method will run before the rebalance and should terminate its execution quickly.
fn post_rebalance<'a>(&self, rebalance: &Rebalance<'a>)
Post-rebalance callback. This method will run after the rebalance and should terminate its execution quickly.
fn commit_callback(
&self,
result: KafkaResult<()>,
offsets: *mut RDKafkaTopicPartitionList
)
&self,
result: KafkaResult<()>,
offsets: *mut RDKafkaTopicPartitionList
)
Post commit callback. This method will run after a group of offsets was committed to the offset store.
Implementors
impl ConsumerContext for DefaultConsumerContext