Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I ensure checkpointing for kafka streams? #102

Open
Vikas-kum opened this issue Jul 8, 2021 · 2 comments
Open

How do I ensure checkpointing for kafka streams? #102

Vikas-kum opened this issue Jul 8, 2021 · 2 comments

Comments

@Vikas-kum
Copy link

Hi,

I have a stream and the current code is repeating the processing of data in streams when restarted. I wanted to make sure that there is some checkpoint written which ensures that processing starts from where the last processing was stopped.

Can anyone let me know how do we ensure such checkpointing?

@snilard
Copy link

snilard commented Aug 5, 2021

Hi,
I am also curious for this. I haven't found any way how to it. I have found that you specify application name in Spark treaming Kinesis connector, but nothing like that is present here :-(

@success-m
Copy link

success-m commented Jan 28, 2022

This seems to work for me:

df.writeStream
.trigger(Trigger.ProcessingTime(interval))
.foreachBatch { (batchDF: DataFrame, batchId: Long) =>
// Transform and write batchDF
batchDF.persist()
//some transformation
batchDF.unpersist()
() // for scala v 2.12 only
}
.option("checkpointLocation", "/path/to/checkpoint")
.start()
.awaitTermination()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants