Reg:Kafka 连接器配置

时间:2021-04-26 08:26:29

标签: apache-kafka-streams apache-kafka-connect confluent-platform confluent-control-center

我正在使用 Kafka 源连接器配置将数据从源表 (Maria DB) 生成到 Kafka 主题中。对于某些表,我在连接配置中使用 mode='timestamp'。 我有两个字段 created_timestampupdated_timestamp。我想根据 updated_timestamp 字段生成记录。但是,updated_timestamp 字段可能包含 NULL 值。

目前,我在查询参数中使用 NVL 函数以在 created_timeupdated_timestamp 时选择 NULL。但是记录没有从源表飞到主题。

Kafka 源连接器配置

curl -k -X POST https://:8083/connectors -H "Content-Type: application/json" -d '{"name": "TEST_SOURCECONNECT","config": {"topic.prefix" : "topic-name","connector.class": "io.confluent.connect.jdbc.JdbcSourceConnector","connection.url": "jdbc:mysql://db ip","connection.user": "" ,"connection.password": "","mode": "timestamp","query": "SELECT t.* from (SELECT *, IFNULL(updated_timestamp, created_timestamp) as custom_timestamp FROM TABLE) t","timestamp.column .name": "custom_timestamp","validate.non.null": "false","poll.interval.ms": 60000}}'

0 个答案:

没有答案