Trait rdkafka::consumer::ConsumerContext [] [src]

pub trait ConsumerContext: Context {
    fn rebalance(&self,
             native_client: &NativeClient,
             err: RDKafkaRespErr,
             partitions_ptr: *mut RDKafkaTopicPartitionList) { ... } fn pre_rebalance(&self, _rebalance: &Rebalance) { ... } fn post_rebalance(&self, _rebalance: &Rebalance) { ... } }

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 it will receive the relabance information. This method is executed as part of the rebalance callback and should terminate its execution quickly.

Post-rebalance callback. This method will run before the rebalance, and it will receive the relabance information. This method is executed as part of the rebalance callback and should terminate its execution quickly.

Implementors