[Solved] kafka consumer properties session.timeout.ms vs heartbeat.interval.ms

Ramya B Asks: kafka consumer properties session.timeout.ms vs heartbeat.interval.ms
I am reading Kafka, the definitive guide and I came across the below point for consumers.

heartbeat.interval.ms must be lower than session.timeout.ms, and is usually set to one-third of the timeout value.

May I know why is it, I thought both should be the same, let’s say if I set the session.timeout.ms to 10s and heartbeat to 3s, then if the consumer takes longer time to process the record, the broker already sends the poll and figures out the consumer already dead and rebalances, in that case, what is the purpose of session timeout property. Am I interpreting it wrong?

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.