title: Kafka consumer - assign and seek
body: <p>I could not understand this API design!</p>
  
  <p>In the below code, we subscribe to a list of topics with dynamically assigned partition. This is totally fine.</p>
  
  <pre><code>    KafkaConsumer&lt;String, String&gt; consumer = new KafkaConsumer&lt;String, String&gt;(properties);
      consumer.subscribe(Arrays.asList("some-topic"));
  
      while(true){
  
          ConsumerRecords&lt;String, String&gt; records = consumer.poll(Duration.ofMillis(100));
          StreamSupport.stream(records.spliterator(), false)
                      .forEach(r -&gt; {
                          System.out.println(r.key() + "::" + r.value());
                      });
  
  
      }
  </code></pre>
  
  <p>Confusion is here.</p>
  
  <pre><code>    KafkaConsumer&lt;String, String&gt; consumer = new KafkaConsumer&lt;String, String&gt;(properties);
      //seek for specific partition
      TopicPartition partition = new TopicPartition("some-topic", 0);
      consumer.assign(Arrays.asList(partition));
      consumer.seek(partition, 0);
  
      while(true){
  
          ConsumerRecords&lt;String, String&gt; records = consumer.poll(Duration.ofMillis(100));
          StreamSupport.stream(records.spliterator(), false)
                  .forEach(r -&gt; {
                      System.out.println(r.key() + "::" + r.value());
                  });
  
  
      }
  </code></pre>
  
  <p><strong>Question:</strong></p>
  
  <ol>
  <li>We have already assigned list of partitions using the <code>assign</code> method. Why does the <code>seek</code> method also look for partition info? Somehow I feel like it is <strong>redundant</strong>. </li>
  <li><code>seek</code> method has the partition with topic and offset. Why does it require a <code>assign</code> first to call a <code>seek</code>?</li>
  </ol>