处理MySQL中多个表的单个KAFKA主题消息
我正在阅读从SFTP连接器到KAFKA主题“ topic1”的CSV文件。 每个记录都包含许多列,这些列需要存储在MySQL数据库中的不同表中。 例如: 每条消息看起来像这样 COL1,COL2,COL3,COL4 我想
- 在表1中插入/更新col1和col2。
:Table1列 - ID,COL1,COL2,TBL2ID
插入/更新Col3和Col4在表2中。
:Table2列 - ID,COL3,COL4
插入过程中每个表中的ID字段是自动生成的。但是对于更新的情况,我需要参考“ COL1”以获取ID值。
使用mySQLCDC连接器,我可以在kafka主题中同步table1和table2数据,并且可以在ksqldb中引用
我的问题: 是否可以使用KSQLDB处理主题中的每个接收消息,以便我可以分开并将其放入不同的主题中,并可以使用接收器连接器写入MySQL表。
I am reading a CSV file from SFTP Connector to Kafka topic ‘Topic1’.
Each record contains a number of columns which need to be stored into different tables in MySql database.
For example:
Each message can look like this
Col1 , Col2, Col3, Col4
I would like to
Insert/Update Col1 and Col2 in Table1.
: Table1 columns - Id, Col1 , Col2, Tbl2Id
Insert/Update Col3 and Col4 in Table2.
: Table2 columns - Id, Col3 , Col4
The Id fields in each table are auto generated during insertion. But for update cases I need to refer to ‘Col1’ to get Id value.
Using MySQLCDC connector, I can sync Table1 and Table2 data in my Kafka topics and can refer in KsqlDB
My question is :
Is it possible to use KsqlDB to process each receiving message in topic so that I can separate and put them into different topics and can use Sink Connectors to write to MySql tables.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论