I'm not a pro at C but it appears that we can pass a -1 as the partition and then the $key will go through the crc32 logic for automatic partitioning. Is that correct?
If so, can that be documented. Also supporting undef() would make for a better perl-ish API.
$err = $topic->produce($partition, $msgflags, $payload, $key);
$err = $topic->produce(-1, $msgflags, $payload, $key); #auto partition based on $key
$err = $topic->produce(undef(), $msgflags, $payload, $key); #future auto partition based on $key