springboot 用引入flink cdc需要配置什么
时间: 2024-05-03 14:20:22 浏览: 83
在使用 Spring Boot 引入 Flink CDC 时,需要添加以下依赖和配置:
1. 添加 Flink CDC 依赖:
```xml
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-connector-kafka_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-connector-jdbc_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
</dependency>
```
2. 配置 Flink CDC:
```yaml
# Flink CDC 配置
flink:
cdc:
kafka-bootstrap-servers: <kafka-bootstrap-servers>
kafka-topic: <kafka-topic>
database: <cdc-database>
table: <cdc-table>
jdbc-url: <jdbc-url>
jdbc-driver: <jdbc-driver-class>
username: <username>
password: <password>
# Flink 配置
flink:
parallelism: 1
checkpoint:
interval: 5s
timeout: 1m
task:
idle-timeout: 1m
```
阅读全文