This PR adds support for consistent partitioning to MRI. The code chooses a consistent partition based on the hash of the :partition_key (CRC32). In the case where :partition_key is nil or an empty string, then it chooses a random partition.
The routines to compute a consistent hash were already in librdkafka, though they weren't exposed in the rdkafka.h header file, so we copied rdcrc32.h. I believe a later release of librdkafka may expose the rd_kafka_msg_partitioner_consistent function, but I don't think there is a tag with it, yet.
This PR adds support for consistent partitioning to MRI. The code chooses a consistent partition based on the hash of the :partition_key (CRC32). In the case where :partition_key is nil or an empty string, then it chooses a random partition.
The routines to compute a consistent hash were already in librdkafka, though they weren't exposed in the rdkafka.h header file, so we copied rdcrc32.h. I believe a later release of librdkafka may expose the rd_kafka_msg_partitioner_consistent function, but I don't think there is a tag with it, yet.