Open datehoer opened 2 years ago
There's no need to call consumer.commitOffsets
from within eachMessage
. A soon as eachMessage
resolves the offset will be committed automatically:
await consumer.run({
eachMessage: async ({topic,partition,message}) => {
await insert(JSON.parse(message.value.toString("utf-8")));
}
})
I'm not entirely sure how to trigger this behavior though. The only thing I can think of is stopping the consumer, but even then I would expect that to have exited out without calling eachMessage
.
thanks,and i closed the kafka autocommit,so it doesn't need to commit?
hello everyone,i think i need some help.
"kafkajs": "1.15.0" “node”: "14.15.0" “server”: "Linux version 4.15.0-124-generic (buildd@lgw01-amd64-029) (gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)) #127-Ubuntu SMP Fri Nov 6 10:54:43 UTC 2020"
so,what should i do?