Kafka API provides functionality for Kafka consumers where it it allows applications to read and process messages from Kafka topics and it is used in applications that need to consume messages. That the common approach we all know for consumers-api. But what is the primary difference between an AsyncKafkaConsumer
and ClassicKafkaConsumer
? Are these primarily used internally by Kafka and not exposed directly via the API?
Kafka API provides functionality for Kafka consumers where it it allows applications to read and process messages from Kafka topics and it is used in applications that need to consume messages. That the common approach we all know for consumers-api. But what is the primary difference between an AsyncKafkaConsumer
and ClassicKafkaConsumer
? Are these primarily used internally by Kafka and not exposed directly via the API?
1 Answer
Reset to default 0AsyncKafkaConsumer and ClassicKafkaConsumer aren't part of Kafka's core API. The Classic Consumer uses a blocking poll() to fetch messages synchronously, giving you full control over processing and offset commits. The Async Consumer fetches and processes messages non-blockingly, often using callbacks or reactive streams. While the Classic Consumer is part of the standard Kafka API, Async patterns are typically implemented by frameworks or libraries on top of Kafka