-
Notifications
You must be signed in to change notification settings - Fork 2.4k
KafkaItemReader reset offset to zero for new job instance #3631
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
Comments
Looks like someone fixed the problem in this PR : #737 , the fix should be embedded in version 4.3.0. |
Hi @alexisgra, |
Hi, I am still observing this behaviour. I have 4.3.3 version of Spring-Batch, I am running it with Spring boot parent 2.5.0. |
@Vickd811 please check this answer on StackOverflow: https://stackoverflow.com/a/65882465/5019386. If you still need support, please add a comment on that SO thread or ask a new question on SO. Thank you. |
Thanks @benas , it resolved the issue. The other behavior i am observing is re-process of last processed offset for a fixed delay scheduled job. So, i am using kafka reader for one of my job where i need to submit the job after every 10 seconds of previous job completion. It is scheduled with a fixed delay, so once first instance of the job is completed, scheduler submits another instance after 10 seconds, the second instance is still picking up the last offset of previous job run. Would you know how to circumvent this? It doesn’t happen when I completely kill the process and restart. |
@Vickd811 Glad it helped. For the other question, please ask it on StackOverflow. We would like to keep the issue tracker exclusively for bug reports and feature requests, see https://github.com/spring-projects/spring-batch/blob/main/SUPPORT.md. Thank you. |
OBSERVED BEHAVIOR
KafkaItemReader always reset offset to zero even when the last job execution was finished OK.
So, if my batch runs every night to process a Kafka topic it doesn't work because it will read all messages every night not just the messages not processed.
ROOT CAUSE
KafkaItemReader line 248:
PROPOSED SOLUTIONS
Remove these lines and don't set offset to 0 anymore.
The text was updated successfully, but these errors were encountered: