Open dearpeach opened 6 years ago
@dearpeach the reason you can't commit is because the commitInterval window is still enforced.
When the consumer first connects it commits, and because the autoCommitIntervalMs
default value is 5000
, your manual commits are ignored until that time has elapsed since the previous commit.
You can use a force commit, by setting the first argument to true
.
This will ignore the commit interval.
consumer.commit(true, (err, data) => {
console.log(err, data);
})
I don't want to set autoCommit, I want to commit message manually?
My code is:
but it doesn't work, kafka still send data again