简体   繁体   English

Kafka JDBC 接收器连接器 - 是否可以将主题数据作为 json 存储在 DB 中

[英]Kafka JDBC sink connector - is it possible to store the topic data as a json in DB

Kafka JDBC sink connector - is it possible to store the topic data as a json into the postgre DB. Kafka JDBC 接收器连接器 - 是否可以将主题数据作为 json 存储到 postgre 数据库中。 Currently it parse each json data from Topic and map it to the corresponding column in the table.目前它将Topic和map中的每个json数据解析到表中的对应列。

If anyone has worked on a similar case, can you please help me what are the config details I should add inside the connector code.如果有人处理过类似的案例,请您帮我在连接器代码中添加哪些配置详细信息。

I used the below code.我使用了下面的代码。 But, it didn't work.但是,它没有用。

"key.converter":"org.apache.kafka.connect.storage.StringConverter",
"key.converter.schemas.enable":"false",
"value.converter":"org.apache.kafka.connect.json.JsonConverter",
"value.converter.schemas.enable":"false"

The JDBC sink requires a Struct type (JSON with Schema, Avro, etc) JDBC 接收器需要 Struct 类型(带有 Schema、Avro 等的 JSON)

If you want to store a string, that string needs to be the value of a key that corresponds to a database column.如果要存储字符串,则该字符串需要是与数据库列对应的键的值。 That string can be anything, including delimited JSON该字符串可以是任何内容,包括分隔的 JSON

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

相关问题 带有 json 架构的 Kafka jdbc 接收器连接器不起作用 - Kafka jdbc sink connector with json schema not working 不支持的源数据类型:从 Kafka 主题消费时 JDBC Postgres Sink Connector 中的 STRUCT 错误 - Unsupported source data type: STRUCT error in JDBC Postgres Sink Connector when consuming from Kafka topic 1 个主题映射到两个不同的数据库表 Kafka Sink Connector - 1 topic maps to two different db table Kafka Sink Connector Kafka Connect-JSON转换器-JDBC Sink连接器-列类型JSON - Kafka Connect - JSON Converter - JDBC Sink Connector - Column Type JSON Kafka Connect JDBC接收器连接器 - Kafka Connect JDBC Sink Connector 使用Kafka Connect API JDBC Sink Connector示例的Oracle数据库的Kafka主题 - Kafka Topic to Oracle database using Kafka Connect API JDBC Sink Connector Example Kafka jdbc sink 连接器创建的数据类型与原始数据类型不匹配 - Kafka jdbc sink connector creates data types that do not matching the original Kafka JDBC Sink Connector,批量插入值 - Kafka JDBC Sink Connector, insert values in batches kafka jdbc sink 连接器独立错误 - kafka jdbc sink connector standalone error 融合的Kafka-connect-JDBC连接器,在kafka主题中显示六进制十进制数据 - Confluent Kafka-connect-JDBC connector showing hexa decimal data in the kafka topic
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM