What does a Kafka consumer lose when it's killed mid-retry? One record vanished.
In a concurrent SmallRye delayed-retry run, one unfinished record never came back after restart.
One unfinished record, fail-slow, never came back after the concurrent consumer restarted.
Question
Does a delayed retry survive a forced restart if a later record finishes first?
What I did
With SmallRye Reactive Messaging and failure-strategy=delayed-retry-topic, I sent four records, forcibly killed the consumer about four seconds later, and restarted it in the same groups.
What I saw
The sequential control processed all four. With @Blocking(ordered=false), only three completed. fail-slow had no completion, no redelivery after restart, and no record on the dead-letter topic, where failed records are sent. The retry group had saved offset 2 as its restart position while the retry at offset 0 was unfinished.
What to do
- Check that the saved retry offset does not advance past unfinished work.
- Test duplicate processing: at-least-once delivery allows a record to run again rather than be lost.
- Make sure side effects tolerate replay.
Limits
Tested with Quarkus 4.0.1, SmallRye 5.0.0, Kafka 4.2.1, one partition, and one forced-kill schedule.
Evidence
I reported issue #3655; it is awaiting a maintainer. ChiradeepDhar proposed PR #3656; it is not merged. I verified the proposed fix on a real broker: fail-slow completed after the kill in all three runs. The loss fuzzer processed all four records, but one already-finished retried record ran twice.