Kafka 如何通过Debezium仅获取创建和更新进程?

eivgtgni  于 2023-04-11  发布在  Apache
关注(0)|答案(1)|浏览(117)

我在PostgreSQL上用pgoutput捕获更改。我只希望有创建和更新的记录。

{
    "name": "transaction-connector",
    "config": {
        "connector.class": "io.debezium.connector.postgresql.PostgresConnector",
        "database.hostname": "localhost",
        "database.port": "5432",
        "database.user": "postgres",
        "database.password": "123123",
        "database.dbname": "walletgate_rg1",
        "table.include.list": "transaction_ctx.transaction",
        "topic.prefix" : "data",
        "decimal.handling.mode": "double",
        "time.precision.mode": "adaptive_time_microseconds",
        "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",
        "include.schema.changes": "false",
        "snapshot.mode": "schema_only",
        "plugin.name": "pgoutput"
    }
}

我该怎么做?
我搜索了Debezium的文件,但没找到结果。

wydwbb8l

wydwbb8l1#

你试过Filter transform吗?

"transforms": "filter",
"transforms.filter.type": "io.debezium.transforms.Filter",
"transforms.filter.language": "jsr223.groovy",
"transforms.filter.condition" : "value.op == 'c' || value.op == 'u'",

相关问题