nerdexam
Confluent

CCDAK · Question #211

You need to explain the best reason to implement the consumer callback interface 'ConsumerRebalanceListener' prior to a Consumer Group Rebalance. Which statement is correct?

The correct answer is A. Partitions assigned to a consumer may change. The best reason to implement the ConsumerRebalanceListener is because partitions assigned to a consumer may change during a rebalance. This interface allows custom logic - such as committing offsets or initializing state - before and after partitions are reassigned.

Developing Kafka Consumers

Question

You need to explain the best reason to implement the consumer callback interface 'ConsumerRebalanceListener' prior to a Consumer Group Rebalance. Which statement is correct?

Options

  • APartitions assigned to a consumer may change.
  • BPrevious log files are deleted.
  • COffsets are compacted.
  • DPartition leaders may change.

How the community answered

(47 responses)
  • A
    89% (42)
  • B
    2% (1)
  • C
    2% (1)
  • D
    6% (3)

Explanation

The best reason to implement the ConsumerRebalanceListener is because partitions assigned to a consumer may change during a rebalance. This interface allows custom logic - such as committing offsets or initializing state - before and after partitions are reassigned.

Topics

#ConsumerRebalanceListener#consumer rebalance#partition assignment#offset commit

Community Discussion

No community discussion yet for this question.

Full CCDAK Practice