title: Kafka - Difference between DefaultPartitioner with MessageKey vs Custom Partitioner?
body: <p>I am trying to send the message to <code>KafkaProducer</code> using <code>ProducerRecord</code>.</p>
  
  <pre><code>new ProducerRecord(topicName,messageKey,message)
  </code></pre>
  
  <p>This uses <code>DefaultPartitioner</code>, DefaultPartitioner will use the hash of the key to ensure that all messages for the same key go to same Partition.</p>
  
  <p>What is the difference between this, and using <code>CustomPartitioner</code>? I hope Custom Partitioner also used to send the message to same partition based on Key.</p>