kafka-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dana Powers <dana.pow...@rd.io>
Subject Re: kafka-python message offset?
Date Wed, 29 Jul 2015 04:58:34 GMT
Hi Keith,

you can use the `auto_offset_reset` parameter to kafka-python's
KafkaConsumer. It behaves the same as the java consumer configuration of
the same name. See
http://kafka-python.readthedocs.org/en/latest/apidoc/kafka.consumer.html#kafka.consumer.KafkaConsumer.configure
for more details on how to configure a KafkaConsumer instance.

For fine-grained control wrt configuring topic/partition offsets, use
KafkaConsumer.set_topic_partitions() . For the most control, pass a
dictionary of {(topic, partition): offset, ...} .
see
http://kafka-python.readthedocs.org/en/latest/apidoc/kafka.consumer.html#kafka.consumer.kafka.KafkaConsumer.set_topic_partitions

-Dana

On Tue, Jul 28, 2015 at 8:47 PM, Keith Wiley <keith.wiley@atigeo.com> wrote:

> I haven’t found a way to specify that a consumer should read from the
> beginning, or from any other explicit offset, or that the offset should be
> “reset” in any way.  The command-line shell scripts (which I believe simply
> wrap the Scala tools) have flags for this sort of thing.  Is there any way
> to do this through the python library?
>
> Thanks.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message