一 .前言
本文为准备flink-connector-kafka 3.4 源码阅读环境.
记得关注一下 flink-connector-kafka里面pom.xml匹配的flink 版本.
二 .安装文件准备
- 环境信息如下:
名称 | 版本 |
---|---|
MAC操作系统 | 15.0.1 |
JDK | 1.8.0_431 |
Maven | 3.8.6 |
Flink Kafka Connector | 3.4 |
- 下载flink代码.
从官方的github下载指定的代码
git clone git@github.com:apache/flink-connector-kafka.git flink-connector-kafka-1.20.0 -b v3.4
三 .编译
mvn clean package -DskipTests
powershell
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Flink : Connectors : Kafka : Parent 3.4.0:
[INFO]
[INFO] Flink : Connectors : Kafka : Parent ................ SUCCESS [ 3.429 s]
[INFO] Flink : Connectors : Kafka ......................... SUCCESS [ 15.211 s]
[INFO] Flink : Connectors : SQL : Kafka ................... SUCCESS [ 2.471 s]
[INFO] Flink : Connectors : Kafka : E2E Tests ............. SUCCESS [ 0.116 s]
[INFO] Flink : E2E Tests : Streaming Kafka base ........... SUCCESS [ 0.835 s]
[INFO] Flink : E2E Tests : Streaming Kafka ................ SUCCESS [ 6.319 s]
[INFO] Flink : E2E Tests : Common Kafka ................... SUCCESS [ 1.515 s]
[INFO] Flink : Connectors : SQL : Kafka : Python .......... SUCCESS [ 3.634 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 33.714 s
[INFO] Finished at: 2025-01-02T10:51:47+08:00
[INFO] ------------------------------------------------------------------------
参考文档:
https://nightlies.apache.org/flink/flink-docs-master/docs/connectors/datastream/kafka/