You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a topic and fill it with more than 1000 messages
Clone the repo and install node modules
Start a single instance of the consumer using npm run start:default
After the consumer has started printing the Processing message... logs, start the second consumer (in a different terminal window) using npm run start:default so the broker starts rebalancing
Expected behavior
A consumer resumes processing messages after rebalancing
Observed behavior
"The group is rebalancing error is logged by kafka logger": {"level":"ERROR","timestamp":"2024-11-04T17:33:27.661Z","logger":"kafkajs","message":"[Connection] Response Heartbeat(key: 12, version: 3)","broker":"kafka:9092","clientId":"pro-content-enricher","error":"The group is rebalancing, so a rejoin is needed","correlationId":49,"size":10}
After some time the "The coordinator is not aware of this member" error is logged: {"level":"ERROR","timestamp":"2024-11-04T17:33:43.956Z","logger":"kafkajs","message":"[Connection] Response JoinGroup(key: 11, version: 5)","broker":"kafka:9092","clientId":"pro-content-enricher","error":"The coordinator is not aware of this member","correlationId":321,"size":81}
After some time the consumer reconnects, and the "Consumer has joined the group" message is logged. This causes rebalancing, and the second consumer (in the second terminal window) is affected. After some time the second one repeats the steps 1-3, and causes the rebalancing of the first one.
Summary: When running multiple consumers they cause a rebalancing loop for each other!
Describe the bug
The consumers don't resume automatically after rebalancing which causes a rebalancing loop.
To Reproduce
The repository to reproduce (https://github.com/maksym-opanasenko/kafkajs-constant-rebalancing/blob/main/ingex.js)
Steps to reproduce
npm run start:default
Processing message...
logs, start the second consumer (in a different terminal window) usingnpm run start:default
so the broker starts rebalancingExpected behavior
A consumer resumes processing messages after rebalancing
Observed behavior
{"level":"ERROR","timestamp":"2024-11-04T17:33:27.661Z","logger":"kafkajs","message":"[Connection] Response Heartbeat(key: 12, version: 3)","broker":"kafka:9092","clientId":"pro-content-enricher","error":"The group is rebalancing, so a rejoin is needed","correlationId":49,"size":10}
{"level":"ERROR","timestamp":"2024-11-04T17:33:43.956Z","logger":"kafkajs","message":"[Connection] Response JoinGroup(key: 11, version: 5)","broker":"kafka:9092","clientId":"pro-content-enricher","error":"The coordinator is not aware of this member","correlationId":321,"size":81}
Summary: When running multiple consumers they cause a rebalancing loop for each other!
Environment:
Important
When running the code from the
indexPatched
file: https://github.com/maksym-opanasenko/kafkajs-constant-rebalancing/blob/main/indexPatched.js, the consumers are able to recover after rebalancing.The text was updated successfully, but these errors were encountered: