只能获取Debezium中的创建和更新过程吗?

huangapple go评论59阅读模式
英文:

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'",

huangapple
  • 本文由 发表于 2023年4月6日 19:36:31
  • 转载请务必保留本文链接:https://go.coder-hub.com/75949065.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定