gpt4 book ai didi

jdbc - Kafka Connect JDBC Sink - 一个接收器配置中每个主题(表)的 pk.fields

转载 作者:行者123 更新时间:2023-12-05 04:02:19 28 4
gpt4 key购买 nike

关于这个例子debezium-example

我有多个主键不同的主题

item (pk : id)
itemDetail (pk :id, itemId)
itemLocation (pk :id, itemId)

jdbc-sink.source

{
"name": "jdbc-sink",
"config": {
"connector.class": "io.confluent.connect.jdbc.JdbcSinkConnector",
"tasks.max": "1",
"topics": "item,itemDetail,itemLocation",
"connection.url": "jdbc:postgresql://postgres:5432/inventory?user=postgresuser&password=postgrespw",
"transforms": "unwrap",
"transforms.unwrap.type": "io.debezium.transforms.UnwrapFromEnvelope",
"auto.create": "true",
"insert.mode": "upsert",
"pk.fields": "id",
"pk.mode": "record_value"
}
}

我们如何为每个主题(表)指定“pk.fields”?

最佳答案

我认为每个主题的 PK 映射没有这样的配置。

您需要为每个主题进行多个配置

{
"name": "jdbc-sink-item",
"config": {
"connector.class": "io.confluent.connect.jdbc.JdbcSinkConnector",
"tasks.max": "1",
"topics": "item",
"pk.fields": "id",

{
"name": "jdbc-sink-itemDetail",
"config": {
"connector.class": "io.confluent.connect.jdbc.JdbcSinkConnector",
"tasks.max": "1",
"topics": "itemDetail",
"pk.fields": "id,itemId",

等等

关于jdbc - Kafka Connect JDBC Sink - 一个接收器配置中每个主题(表)的 pk.fields,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54438684/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com