title: How to get current offsets for all partitions for my consumer?
body: <p>I am trying to get the current offsets for each partition available. According to the docs, <a href="https://docs.confluent.io/current/clients/confluent-kafka-python/index.html?highlight=offset#confluent_kafka.Consumer.position" rel="nofollow noreferrer">consumer.position</a> should do the trick, so I tried like so:</p>
  
  <pre class="lang-py prettyprint-override"><code>consumer = Consumer({
      'bootstrap.servers': config.BOOTSTRAP_SERVERS,
      'group.id': config.CONSUMER_GROUP,
      'enable.auto.commit': False,
  })
  
  # get all topics
  topics = consumer.list_topics()
  
  # get all partitions
  partitions = []
  for name, meta  in topics.topics.items():
      for partition_id in meta.partitions.keys():
          part = TopicPartition(name, partition_id)
          partitions.append(part)
  
  # get all offsets
  x = consumer.position(partitions)
  </code></pre>
  
  <p>However, all the offsets in the resulting partitions in <code>x</code> are still <code>-1001</code>. </p>
  
  <p>If I check with lenses or some other tool, I can see that this result is not correct, the consumer group I'm unsing has consumed messages and committed them to Kafka.</p>