0.8.2 Kafka Producer 是否为您管理分区?

Does the 0.8.2 Kafka Producer manage partitioning for you?

我很难理解什么(如果有的话)相当于新的 0.8.2 生产者中的 0.8.0 "partitioner.class" 配置 属性。

我相信 0.8.2 他们引入了 org.apache.kafka.clients.producer.ProducerRecord<K,V> 形式,它采用主题名称、可选的分区号以及可选的键和值。您通常可以像

这样使用它
    ProducerRecord<String,String> producerRecord = new ProducerRecord<String,String>(topic, key, value);

From the doc

If a valid partition number is specified that partition will be used when sending the record. If no partition is specified but a key is present a partition will be chosen using a hash of the key. If neither key nor partition is present a partition will be assigned in a round-robin fashion.