1 Spring-Kafka快速入门
在 Spring 生态中,提供了 Spring-Kafka 项目,让我们更简便的使用 Kafka 。其官网介绍如下:
The Spring for Apache Kafka (spring-kafka) project applies core Spring concepts to the development of Kafka-based messaging solutions.
Spring for Apache Kafka (spring-kafka) 项目将 Spring 核心概念应用于基于 Kafka 的消息传递解决方案的开发。It provides a “template” as a high-level abstraction for sending messages.
它提供了一个“模板”作为发送消息的高级抽象。It also provides support for Message-driven POJOs with @KafkaListener annotations and a “listener container”.
它还通过 @KafkaListener 注解和“侦听器容器(listener container)”为消息驱动的 POJO 提供支持。These libraries promote the use of dependency injection and declarative.
这些库促进了依赖注入和声明的使用。In all of these cases, you will see similarities to the JMS support in the Spring Framework and RabbitMQ support in Spring AMQP.
在所有这些用例中,你将看到 Spring Framework 中的 JMS 支持,以及和 Spring AMQP 中的 RabbitMQ 支持的相似之处。
- 注意,Spring-Kafka 是基于 Spring Message 来实现 Kafka 的发送端和接收端。
