title: Read from specific Kafka topic using Python
body: <p>I have topic with 3 partitions and I'm trying to read from each specific partition using following code</p>
  
  <pre><code>from kafka import KafkaConsumer, TopicPartition
  
  brokers = 'localhost:9092'
  topic = 'b3'
  
  m = KafkaConsumer(topic, bootstrap_servers=['localhost:9092'])
  par = TopicPartition(topic=topic, partition=1)
  m.assign(par)
  </code></pre>
  
  <p>but I am getting this error:</p>
  
  <pre><code>    raise IllegalStateError(self._SUBSCRIPTION_EXCEPTION_MESSAGE)
  kafka.errors.IllegalStateError: IllegalStateError: You must choose only one way to configure your consumer: (1) subscribe to specific topics by name, (2) subscribe to topics matching a regex pattern, (3) assign itself specific topic-partitions.
  </code></pre>
  
  <p>Can somebody help me with this? </p>