title: Cannot get KafkaConsumer messages without hanging
body: <p>I've written some data into my one-partition topic with a <code>KafkaProducer</code>, I'm trying to view this data using a <code>KafkaConsumer</code> by either looping through the consumer or <code>poll()</code></p>
  
  <pre><code>import time
  from datetime import datetime, timedelta
  from kafka import KafkaProducer, KafkaConsumer, TopicPartition
  
  consumer = KafkaConsumer(bootstrap_servers='localhost:9092',group_id='my-group',enable_auto_commit=False)
  tp = TopicPartition(topic_name, 0)
  consumer.assign([tp])
  consumer.seek_to_end(tp)
  last_offset = consumer.position(tp)
  producer = KafkaProducer(bootstrap_servers='localhost:9092')
  
  stopWriting = datetime.now() + timedelta(seconds=10)
  while datetime.now() &lt; stopWriting:
      producer.send(topic='my-topic',value=str(datetime.now()).encode('utf-8'))
      time.sleep(1)
  
  producer.close()
  consumer.seek(tp, last_offset)
  
  #looping through the consumer
  for msg in consumer:
      print(msg)
  
  # or looping through the polled messages 
  for msg in consumer.poll():
      print(msg)
  </code></pre>
  
  <p>Neither one seems to work properly, the consumer loop does print out the messages, but always ended up hanging by an infinite loop within <code>kafka/consumer/group.py(886)_message_generator</code>. The poll loop doesn't print anything out at all. Is there something I'm missing to read out all of the newly made messages without hanging the program? I'm using Python 3.6.1 and <code>kafka-python</code> version 1.3.4</p>