【问题标题】:What is the difference between Apache Kafka and Kafka Streams on Spring Cloud Stream?Spring Cloud Stream 上的 Apache Kafka 和 Kafka Streams 有什么区别?
【发布时间】:2021-09-03 06:37:43
【问题描述】:

在 Spring Cloud 网站 (https://spring.io/projects/spring-cloud-stream) 中,列出了要使用的活页夹选项。我们有 Apache Kafka 和 Kafka Streams 选项。

  1. 它们有什么区别?
  2. 出于什么目的我们应该在这两者之间进行选择?

【问题讨论】:

  • 你问的是 Apache Kafka 和 Kafka Streams 之间的区别吗?
  • 是的!它们之间的区别

标签: apache-kafka spring-cloud


【解决方案1】:

Apache Kafka binder 用于基本的 kafka 客户端使用 consumer/producer api,

Kafka Stream binder 是基于 apache kafka binder 构建的,并增加了使用 kafka Streams api 的能力,

Kafka 流 api 是轻量级代码库,它为您提供了将数据从 kafka 中的 topic/s 操作到 kafka 中的其他 topic/s 的功能,允许您转换、增强、过滤、加入、聚合等...


Apache Kafka Binder 实现将每个目标映射到一个 Apache Kafka 主题。消费者组直接映射到相同的 Apache Kafka 概念。分区也直接映射到 Apache Kafka 分区。

活页夹当前使用 Apache Kafka kafka-clients 版本 2.3.1。此客户端可以与较旧的代理进行通信(请参阅 Kafka 文档),但某些功能可能不可用。例如,对于 0.11.x.x 之前的版本,不支持本机标头。另外,0.11.x.x 不支持 autoAddPartitions 属性

https://docs.spring.io/spring-cloud-stream-binder-kafka/docs/3.1.3/reference/html/spring-cloud-stream-binder-kafka.html#_apache_kafka_binder

Spring Cloud Stream 包含一个专门为 Apache Kafka Streams 绑定设计的绑定器实现。通过这种原生集成,Spring Cloud Stream“处理器”应用程序可以直接在核心业务逻辑中使用 Apache Kafka Streams API。

Kafka Streams binder 实现建立在 Spring for Apache Kafka 项目提供的基础之上。

Kafka Streams binder 为 Kafka Streams 中的三种主要类型 - KStream、KTable 和 GlobalKTable 提供绑定能力。

Kafka Streams 应用程序通常遵循从入站主题读取记录、应用业务逻辑,然后将转换后的记录写入出站主题的模型。或者,也可以定义一个没有出站目的地的处理器应用程序。

https://docs.spring.io/spring-cloud-stream-binder-kafka/docs/3.1.3/reference/html/spring-cloud-stream-binder-kafka.html#_kafka_streams_binder

【讨论】:

  • 谢谢!帮了大忙!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-04-28
  • 2018-07-15
  • 1970-01-01
相关资源
最近更新 更多