pub unsafe extern "C" fn rd_kafka_assign(
rk: *mut rd_kafka_t,
partitions: *const rd_kafka_topic_partition_list_t,
) -> rd_kafka_resp_err_t
Expand description
Atomic assignment of partitions to consume.
The new `partitions will replace the existing assignment.
A zero-length partitions will treat the partitions as a valid, albeit empty assignment, and maintain internal state, while a
NULL
value for `partitions will reset and clear the internal state.
When used from a rebalance callback, the application should pass the partition list passed to the callback (or a copy of it) even if the list is empty (i.e. should not pass NULL in this case) so as to maintain internal join state. This is not strictly required - the application may adjust the assignment provided by the group. However, this is rarely useful in practice.
Returns An error code indicating if the new assignment was applied or not. RD_KAFKA_RESP_ERR__FATAL is returned if the consumer has raised a fatal error.