admin管理员组

文章数量:1336632

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?

Share Improve this question asked Nov 20, 2024 at 20:12 Panagiotis DrakatosPanagiotis Drakatos 3,2644 gold badges36 silver badges46 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

AsyncKafkaConsumer 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

本文标签: