RRM
RRM

Reputation: 2679

kafka topic partition rebalance notification

I'm using Kafka 0.8.1.1

Is there any API (callback etc.) using which the lost partitions or newly added partitions to a consumer could be found?

Upvotes: 2

Views: 855

Answers (1)

florins
florins

Reputation: 1655

I'm using Kafka 0.9.1 API and there is an interface ConsumerRebalanceListener with two methods

public void onPartitionsRevoked(Collection partitions) where

partitions The list of partitions that were assigned to the consumer on the last rebalance

public void onPartitionsAssigned(Collection partitions)

partitions The list of partitions that are now assigned to the consumer (may include partitions previously assigned to the consumer)

Upvotes: 2

Related Questions