简体   繁体   English

Kafka Source JDBC 连接器-微批处理

[英]Kafka Source JDBC Connector - Micro-batching

As part of a POC, I have a Kafka JDBC Source Connector task which basically reads all the contents of a MySQL table and dumps the records into a Kafka topic.作为 POC 的一部分,我有一个 Kafka JDBC Source Connector 任务,它基本上读取 MySQL 表的所有内容并将记录转储到 Kafka 主题中。

The table contains 2 records only & my batch.max.rows value is 2. When the task runs on "bulk" mode, I see 2 individual JSON records in the kafka topic.该表仅包含 2 条记录,并且我的 batch.max.rows 值为 2。当任务以“批量”模式运行时,我在 kafka 主题中看到 2 条单独的 JSON 记录。 How would I configure the connector to insert 1 JSON record which contains a JSON array containing those 2 records.如何配置连接器以插入 1 个 JSON 记录,其中包含一个包含这 2 个记录的 JSON 数组。 Ultimately the no.最终没有。 of messages published to kafka topic to be 1 instead of 2.发布到 kafka 主题的消息数为 1 而不是 2。

Each database row will become a unique Kafka record.每个数据库行都将成为唯一的 Kafka 记录。

If you want to join / window records, then you would use a Stream Processor如果您想加入 / window 记录,那么您将使用 Stream 处理器

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM