Kafka Connect JDBC Sink连接器:如何删除具有两个PK(复合键)的记录?

时间:2020-06-12 00:53:56

标签: postgresql apache-kafka apache-kafka-connect debezium

对不起,我英语不好。我是kafka-connect的新手。问题是我通过Kafka从Postgres数据库中提取数据,因此我使用Kafka-connect(debezium)将数据放在另一个Postgres数据库中。我有带有复合键的表,例如(ref_id PK,lang_id PK)。问题是当我将这张桌子下沉到Postgres时。创建,插入和更新表可以完美地工作,但是在删除行时,SinkConnecter会中断。如何解决至少JdbcSinkConnector没有中断的记录可以被删除就可以了吗? debezium接收器连接器配置为:

{       "connector.class": "io.confluent.connect.jdbc.JdbcSinkConnector",
        "taks.max": "2",
        "topics.regex": "^xxxx_(.*).(.*)_ml$",
        "connection.user": "xxxx",
        "table.name.format": "${topic}",
        "connection.password": "xxxx",
        "connection.url": "jdbc:postgresql://xx.xx.xxx.xx:5432/xxxx?currentSchema=data&user=xxxx&password=xxxx",
        "auto.create": "true",
        "auto.evolve": "true",
        "transforms": "dropPrefix, unwrap",
        "transforms.unwrap.type": "io.debezium.transforms.ExtractNewRecordState",
        "transforms.unwrap.drop.tombstones": "false",
        "insert.mode": "upsert",
        "pk.mode": "record_value",
        "pk.fields": "id,lang_id",
        "delete.enabled": "false" 
}

PreparedStatementBinder.class在第125行中断NullPointerException;

0 个答案:

没有答案