KafkaConsumer 0.10 Java API error message: No current assignment for partition : <p>I am using KafkaConsumer 0.10 Java api. I want to consume from a specific partition and specific offset. I looked up and found that there is a seek method but its throwing an exception. Anyone had a similar use case or solution ?</p>

<p>Code:</p>

<pre><code>KafkaConsumer&lt;String, byte[]&gt; consumer = new KafkaConsumer&lt;&gt;(consumerProps);
consumer.seek(new TopicPartition("mytopic", 1), 4);
</code></pre>

<p>Exception</p>

<pre><code>java.lang.IllegalStateException: No current assignment for partition mytopic-1
    at org.apache.kafka.clients.consumer.internals.SubscriptionState.assignedState(SubscriptionState.java:251)
    at org.apache.kafka.clients.consumer.internals.SubscriptionState.seek(SubscriptionState.java:276)
    at org.apache.kafka.clients.consumer.KafkaConsumer.seek(KafkaConsumer.java:1135)
    at xx.xxx.xxx.Test.main(Test.java:182)
</code></pre>
