tulios / kafkajs

A modern Apache Kafka client for node.js

Home Page:https://kafka.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question: does KafkaJS consumer heartbeat between retries?

rgolder1 opened this issue · comments

Hi,
If KafkaJS is retrying a message using its retry mechanism, I understand this happens within the consumer poll. i.e. it is not retried off the topic. The total retry period could well exceed the sessionTimeout, which would trigger the broker to remove the consumer from the consumer group, trigger a rebalance, and redeliver the message. Is my understanding correct here, or does it perhaps heartbeart between each retry to keep the consumer alive?
Thanks,
Rob

It took some time since you've asked the question. Do you know if you have an answer to that already?

I'd suggest to reverse-engineer and look for an answer yourself. Your question is interesting that's why I can recommend some steps. For that exercise, you would need to understand what happens in the code of consumer https://github.com/tulios/kafkajs/blob/master/src/consumer/index.js#L206.

And to better see what happens when. I'd suggest setting a consumer example with a prop logLevel: logLevel.DEBUG, on Kafka object. And running that.

I would expect that heartbeat doesn't interfere with retries. I would be surprised if it does.

Let me know if that helps?