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

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.

Pre-rebalance callback. This method will run before the rebalance and should terminate its execution quickly.

Post-rebalance callback. This method will run after the rebalance and should terminate its execution quickly.

Post commit callback. This method will run after a group of offsets was committed to the offset store.

Implementors