I am trying to write a Kafka producer using librdkafka (c code library). I do not want my application to have to manually round-robin through the number of partitions on a topic. In the Java version of the Kafka Producer, this is possible by not specifying the partition or key. The documentation in librdkafka states the following:
* \p partition is the target partition, either:
* - RD_KAFKA_PARTITION_UA (unassigned) for
* automatic partitioning using the topic's partitioner function, or
* - a fixed partition (0..N)
RD_EXPORT
int rd_kafka_produce(rd_kafka_topic_t *rkt, int32_t partition,
int msgflags,
void *payload, size_t len,
const void *key, size_t keylen,
void *msg_opaque);
So what is the topic's partitioner function? I cannot find documentation on this anywhere. Is this round-robin by default? Is this something I need to enable in Zookeeper?