You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Skip Montanaro <sk...@gmail.com> on 2017/10/17 20:02:33 UTC
Can I commit the same offset? Can I back up?
I'm a pretty wet-behind-the-ears Kafka user, but I really like it. I
was up and running with the basics in just a few minutes (I use
kafka-python - dunno if that makes a difference).
For my own nefarious reasons, I generally run with enable_auto_commit
== False in my consumers. I'm just using Kafka's default commit
capability, nothing more sophisticated so far. Is it okay to commit
out-of-sequence, effectively allowing me to back up and replay
messages? For example, if I receive offsets 12, 13, 14, and 15,
committing as each is received, then some other external condition
dictates that I should reprocess the message at offset 13 again, can I
simply call ... commit(12) ... ?
Similar, but maybe not as harsh, If I have some bit of long processing
to do, can I just periodically commit the offset of the message I last
processed to keep the kafka.errors.CommitFailedError timeout gods
happy?
Thanks,
Skip Montanaro
Re: Can I commit the same offset? Can I back up?
Posted by Skip Montanaro <sk...@gmail.com>.
> For my own nefarious reasons, I generally run with enable_auto_commit
> == False in my consumers. I'm just using Kafka's default commit
> capability, nothing more sophisticated so far. Is it okay to commit
> out-of-sequence, effectively allowing me to back up and replay
> messages? For example, if I receive offsets 12, 13, 14, and 15,
> committing as each is received, then some other external condition
> dictates that I should reprocess the message at offset 13 again, can I
> simply call ... commit(12) ... ?
Eh... never mind. My calls to commit() are buried in some library code
I wrote and promptly forgot about. There is no ability in the default
commit mechanism to commit specific offsets. I'll have to cook up some
local storage to deal with received-but-not-yet-entirely-processed
messages.
Apologies for the noise...
Skip