Skip to content

manual checkpoint  #1617

@sivankumar86

Description

@sivankumar86

Description

I am using 2 process to read from kafka and write to destination (design of ELT tool) hence, I would like to maintain checkpoint/offset manually and read it from where it left on last run . however, it is reading old record i.e last checkpoint record.

How to reproduce

def reset_offset(self, consumer, partitions):
"""
set the topic starting point
"""
for p in partitions:
name = str(p.partition)
if name in self.state_update:
p.offset = self.state_update[name] ## from checkpoint lookup
else:
p.offset = OFFSET_BEGINNING
consumer.assign(partitions)

self.consumer.subscribe([self.topic], on_assign=self.reset_offset)

It always return last read record on next run. I would like to skip and read only next record from last checkpoint.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionA question about how to use or about expected behavior of the library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy