title: Kafka consumer api failed to subscribe to topic
body: <p>I am using simple Kafka client API. As far as I know there are two ways to consumer messages, subscribe to a topic and assign partition to consumer.</p>
  
  <p>However the first method does not work. Consumer <code>poll()</code> would hang forever. It only works with <code>assign</code>.</p>
  
  <pre><code>    // common config for consumer
      Map&lt;String, Object&gt; config = new HashMap&lt;&gt;();
      config.put("bootstrap.servers", bootstrap);
  
      config.put("group.id", KafkaTestConstants.KAFKA_GROUP);
      config.put("enable.auto.commit", "true");
      config.put("auto.offset.reset", "earliest");
      config.put("key.deserializer", StringDeserializer.class.getName());
      config.put("value.deserializer", StringDeserializer.class.getName());
      StringDeserializer deserializer = new StringDeserializer();
      KafkaConsumer&lt;String, String&gt; consumer = new KafkaConsumer&lt;&gt;(config, deserializer, deserializer);
  
      // subscribe does not work, poll() hangs
      consumer.subscribe(Arrays.asList(KafkaTestConstants.KAFKA_TOPIC));
  </code></pre>
  
  <p>Here is the code that works by assigning the partition.</p>
  
  <pre><code>    // assign works
      TopicPartition tp = new TopicPartition(KafkaTestConstants.KAFKA_TOPIC, 0);
      List&lt;TopicPartition&gt; tps = Arrays.asList(tp);
      consumer.assign(tps);
  </code></pre>
  
  <p>Since I'd like to utilize the auto commit feature which is supposed to only work with consumer group management according to this <a href="https://stackoverflow.com/questions/42701394/why-doesnt-offset-get-updated-when-messages-are-consumed-in-kafka">post</a>. Why does not <code>subscribe()</code> work?</p>