I am s beginner on Kafka and also this library. I need the offset to be committed only after the code successfully finishes in the eachMessage callback. Does this work out of the box? I mean, if I throw an error inside the callback, the offset won't be committed? Or is the offset automatically committed no matter what happens in eachMessage's callback?
Yes, if you throw an error inside eachMessage it won't commit the offset.
Hi tulios, thank you for the help. Based on this, I should keep autoCommit: true, right?
yes and you can configure how aggressive you want the auto-commit to be
https://kafka.js.org/docs/consuming#autocommit
Feel free to re-open the issue if you have more questions
Most helpful comment
yes and you can configure how aggressive you want the auto-commit to be
https://kafka.js.org/docs/consuming#autocommit