title: KafKa partitioner class, assign message to partition within topic using key
body: <p>I am new to kafka so apology if I sound stupid but what I understood so far
  is .. A stream of message can be defined as a topic, like a category. And every topic is divided 
  into one or more partitions (each partition can have multiple replicas). so they act in parallel </p>
  
  <p>From the Kafka <a href="http://kafka.apache.org/introduction.html">main site</a> they say</p>
  
  <blockquote>
    <p>The producer is able to chose which message to assign to which partition within the topic.
    This can be done in a round-robin fashion simply to balance load or it can be done according to some semantic partition function (say based on some key in the message).</p>
  </blockquote>
  
  <p>Does this mean while consuming I will be able to choose the message offset from particular partition?
  While running multiple partitions is it possible to choose from one specific partition  i.e partition 0?   </p>
  
  <p>In Kafka 0.7 <a href="http://kafka.apache.org/07/quickstart.html">quick start</a> they say </p>
  
  <blockquote>
    <p>Send a message with a partition key. Messages with the same key are sent to the same partition.</p>
  </blockquote>
  
  <p>And the key can be provided while creating the producer as below</p>
  
  <pre><code>    ProducerData&lt;String, String&gt; data = new ProducerData&lt;String, String&gt;("test-topic", "test-key", "test-message");
      producer.send(data);
  </code></pre>
  
  <p>Now how do I consume message based on this key? what is the actual impact of using this key while producing in Kafka ? <br/></p>
  
  <p>While creating producer in 0.8beta we can provide the partitioner class attribute through the config file.
  The custom partitioner class can be perhaps created implementing the kafka partitioner interface.
  But m little confused how exactly it works. 0.8 doc also does not explain much. Any advice or m i missing something ?</p>