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

Consumer is getting disconnected even when heartbeat is getting sent regularly

abhinavgautam07 opened this issue · comments

Describe the bug
Consumer instance gets disconnected even when the heartbeat is sent every 5 sec and also when a message gets processed. But somehow consumer gets disconnected (sessionTimeout is 40 secs). Found no anomaly in broker metrics and logs. Sometimes also getting the logs broker closed the connection. Not able to debug the issue, need help in debugging.

Expected behavior
If the heartbeat is getting sent and there is no issue from the broker side, the consumer should not fail at failIfNotConnected.

Observed behavior
Consumer instance gets disconnected even when the heartbeat is sent every 5 sec and also when a message gets processed. But somehow consumer gets disconnected (sessionTimeout is 40 secs). Found no anomaly in broker metrics and logs. Sometimes also getting the logs broker closes the connection. Not able to debug the issue, need help in debugging.

Environment:

  • OS: ubuntu (docker)
  • KafkaJS version: v1.16.0
  • Kafka version 3.1.0
  • NodeJS version v14.18.0

Additional context
Messages are not consumed right away, with each message, handler we get the messages, store them in the queue then process them at a slower rate.