英文:
How can I get only the create and update processes through Debezium?
问题
I'm capturing changes with pgoutput on PostgreSQL. I want only records with create and update to come.
{
    "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"
    }
}
How can I do that?
I did a search on the Debezium document, but I couldn't find the result.
英文:
I'm capturing changes with pgoutput on PostgreSQL. I want only records with create and update to come.
{
    "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"
    }
}
How can I do that?
I did a search on the Debezium document, but I couldn't find the result.
答案1
得分: 1
你尝试过使用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'",
英文:
Have you tried a 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'",
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论