kafka官方提供生产者api发送消息、消费者api获取消息
本系列教程使用 kafka_2.12-2.4.1 ,官网文档:
http://kafka.apache.org/24/documentation.html#producerapi
官方依赖:
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-clients</artifactId>
<version>2.4.1</version>
</dependency>
使用 kafka-clients 2.4.1版本操作 kafka_2.12-2.4.1
但本文不做该 api 的介绍,因为 一般都是通过springboot操作kafka