The consumer thread polls the KafkaConsumer
for messages and hands them over to the listener thread which invokes your listener.
This was required with early versions of the KafkaConsumer
because a slow listener could cause partition rebalancing - the heartbeats had to be sent on the consumer thread.
They have now fixed this in the KafkaConsumer
(heartbeats are sent in the background) so in 2.0 we will only have one thread type and the listener is invoked on the consumer thread. 2.0.0.M2 (milestone 2) is available now; the release is planned for around the end of next month.