-
How does the parallel consumer handle rebalancing? Suppose the partition from where the parallel consumer is processing records from, gets revoked. How would it handle this? We don't pass a Rebalance Listener with the KafkaConsumer in the examples I have seen. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Parallel Consumer does state cleanup / finalization on Partition revocation - WorkManager is implementing Rebalance Listener and initialization on Partition assignment. It is logic internal to Parallel Consumer to handle its internal state on Partition events and does not require user to pass additional rebalance listeners. |
Beta Was this translation helpful? Give feedback.
-
In addition if user code requires tracking of those events - the subscribe overload with ConsumerRebalanceListener can be used - the callback provided will be invoked after internal processing of the partition events is done. |
Beta Was this translation helpful? Give feedback.
Parallel Consumer does state cleanup / finalization on Partition revocation - WorkManager is implementing Rebalance Listener and initialization on Partition assignment. It is logic internal to Parallel Consumer to handle its internal state on Partition events and does not require user to pass additional rebalance listeners.
public class WorkManager<K, V> implements ConsumerRebalanceListener