Skip to content
Advertisement

Can an offset of an unassigned partition be committed by KafkaConsumer.commitSync/commitAsync

JavaScript

Can above method be used to commit offset of an unassigned TopicPartition ?

I know ConsumerRebalanceListener.onPartitionsRevoked is the right place to do final offset commit before TopicPartition rebalance.

But if I commit offset of a partition which consumer does not have in its assigned list now, e.g. it lost it after rebalance, how will Kafka treat it?

Advertisement

Answer

It will throw the following Exception:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement