最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

java - What is the main difference between AsyncKafkaConsumer and ClassicKafkaConsumer in Apache-Kafka - Stack Overflow

programmeradmin1浏览0评论

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

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论