<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question How can i consume kafka offsets based on timestamp? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-i-consume-kafka-offsets-based-on-timestamp/m-p/114090#M30409</link>
    <description />
    <pubDate>Wed, 01 Jun 2016 19:07:19 GMT</pubDate>
    <dc:creator>sanjeev_verma82</dc:creator>
    <dc:date>2016-06-01T19:07:19Z</dc:date>
    <item>
      <title>How can i consume kafka offsets based on timestamp?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-i-consume-kafka-offsets-based-on-timestamp/m-p/114090#M30409</link>
      <description />
      <pubDate>Wed, 01 Jun 2016 19:07:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-i-consume-kafka-offsets-based-on-timestamp/m-p/114090#M30409</guid>
      <dc:creator>sanjeev_verma82</dc:creator>
      <dc:date>2016-06-01T19:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: How can i consume kafka offsets based on timestamp?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-i-consume-kafka-offsets-based-on-timestamp/m-p/114091#M30410</link>
      <description>&lt;P&gt;if you commit the offset based on timestamp you can start consuming from kafka at next batch cycle&lt;/P&gt;&lt;P&gt;like this&lt;/P&gt;&lt;P&gt;--commit last consumed

consumer = KafkaConsumer(bootstrap_servers='localhost:9092') &lt;/P&gt;&lt;P&gt;tp = TopicPartition(topic, partition) 
consumer.seek(tp, end) 
consumer.commit() 

--now start consuming offset from Kafka when the job restarts at the next batch cycle: 

consumer.assign([tp]) 
&lt;/P&gt;&lt;P&gt;start = consumer.committed(tp)&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2016 19:17:20 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-i-consume-kafka-offsets-based-on-timestamp/m-p/114091#M30410</guid>
      <dc:creator>rajkumar_singh</dc:creator>
      <dc:date>2016-06-01T19:17:20Z</dc:date>
    </item>
  </channel>
</rss>

