PartitionerCb

Partitioner callback

Return the partition to use for \p key in \p topic.

The \p msg_opaque is the same \p msg_opaque provided in the Producer::produce() call.

Note: \p key may be null or the empty.

Must return a value between 0 and \p partition_cnt (non-inclusive). May return RD_KAFKA_PARTITION_UA (-1) if partitioning failed.

alias PartitionerCb = int delegate
(
const Topic topic
,
const(void)[] key
,,)
nothrow @nogc

See Also

The callback may use Topic::partition_available() to check if a partition has an active leader broker.

Meta