Group rebalance callback for use with KafkaConsunmer
Registering a \p rebalance_cb turns off librdkafka's automatic
partition assignment/revocation and instead delegates that responsibility
to the application's \p rebalance_cb.
The rebalance callback is responsible for updating librdkafka's
assignment set based on the two events: ASSIGN_PARTITIONS
and REVOKE_PARTITIONS but should also be able to handle
arbitrary rebalancing failures where \p err is neither of those.
Note: In this latter case (arbitrary error), the application must
call unassign() to synchronize state.
Without a rebalance callback this is done automatically by librdkafka
but registering a rebalance callback gives the application flexibility
in performing other operations along with the assinging/revocation,
such as fetching offsets from an alternate location (on assign)
or manually committing offsets (on revoke).
Group rebalance callback for use with KafkaConsunmer
Registering a \p rebalance_cb turns off librdkafka's automatic partition assignment/revocation and instead delegates that responsibility to the application's \p rebalance_cb.
The rebalance callback is responsible for updating librdkafka's assignment set based on the two events: ASSIGN_PARTITIONS and REVOKE_PARTITIONS but should also be able to handle arbitrary rebalancing failures where \p err is neither of those. Note: In this latter case (arbitrary error), the application must call unassign() to synchronize state.
Without a rebalance callback this is done automatically by librdkafka but registering a rebalance callback gives the application flexibility in performing other operations along with the assinging/revocation, such as fetching offsets from an alternate location (on assign) or manually committing offsets (on revoke).