Kafka python consumer reading all the messages when started
<p>I am using the below code to read messages from a topic. I am facing two issues.
Whenever i start consumer, it is reading all the messages in the queue? 
How do read only the unread messages?</p>

<pre><code>from kafka import KafkaConsumer


consumer = KafkaConsumer('my-topic',
                         group_id='my-group',
                         bootstrap_servers=['localhost:9092'])
for message in consumer:
    consumer.commit() 
    # message value and key are raw bytes -- decode if necessary!
    # e.g., for unicode: `message.value.decode('utf-8')`
    print ("%s:%d:%d: key=%s value=%s" % (message.topic, message.partition,
                                          message.offset, message.key,
                                          message.value))
</code></pre>