does kafka rebalancing of consumer matters on the poll we are calling from the application. I have 4 consumers for 4 different topics running in a java application and each of them are polling 500 messages and keeping them in memory for processing.
Another thread, reading these already fetched message one by one from all 4 consumer in round robin manner and once all 2000 messages are processed, the poll for the consumers is called again.
During this process, i see that kafka consumer rebalancing is happening and no messages are consumed for 3-4 minutes and then it resumes. This is happening very frequently, I have verified that
• My consumers are not increasing or decreasing - they are fixed
• No partitions are added/removed during the run
• The application CPU usage is minimal. Around 30% in both the pods
As per my assumption, rebalance should not rely on when i am calling the poll. Instead, heartbeat interval will tell the broker that consumer is alive and avoid rebalance. Please clarify this and help me on this understanding.