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

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

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.

  1. {
  2. "name": "transaction-connector",
  3. "config": {
  4. "connector.class": "io.debezium.connector.postgresql.PostgresConnector",
  5. "database.hostname": "localhost",
  6. "database.port": "5432",
  7. "database.user": "postgres",
  8. "database.password": "123123",
  9. "database.dbname": "walletgate_rg1",
  10. "table.include.list": "transaction_ctx.transaction",
  11. "topic.prefix": "data",
  12. "decimal.handling.mode": "double",
  13. "time.precision.mode": "adaptive_time_microseconds",
  14. "key.converter": "org.apache.kafka.connect.storage.StringConverter",
  15. "key.converter.schemas.enable": "false",
  16. "value.converter": "org.apache.kafka.connect.json.JsonConverter",
  17. "value.converter.schemas.enable": "false",
  18. "include.schema.changes": "false",
  19. "snapshot.mode": "schema_only",
  20. "plugin.name": "pgoutput"
  21. }
  22. }

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.

  1. {
  2. "name": "transaction-connector",
  3. "config": {
  4. "connector.class": "io.debezium.connector.postgresql.PostgresConnector",
  5. "database.hostname": "localhost",
  6. "database.port": "5432",
  7. "database.user": "postgres",
  8. "database.password": "123123",
  9. "database.dbname": "walletgate_rg1",
  10. "table.include.list": "transaction_ctx.transaction",
  11. "topic.prefix" : "data",
  12. "decimal.handling.mode": "double",
  13. "time.precision.mode": "adaptive_time_microseconds",
  14. "key.converter": "org.apache.kafka.connect.storage.StringConverter",
  15. "key.converter.schemas.enable": "false",
  16. "value.converter": "org.apache.kafka.connect.json.JsonConverter",
  17. "value.converter.schemas.enable": "false",
  18. "include.schema.changes": "false",
  19. "snapshot.mode": "schema_only",
  20. "plugin.name": "pgoutput"
  21. }
  22. }

How can I do that?

I did a search on the Debezium document, but I couldn't find the result.

答案1

得分: 1

你尝试过使用Filter transform吗?

  1. "transforms": "filter",
  2. "transforms.filter.type": "io.debezium.transforms.Filter",
  3. "transforms.filter.language": "jsr223.groovy",
  4. "transforms.filter.condition": "value.op == 'c' || value.op == 'u'",
英文:

Have you tried a Filter transform?

  1. "transforms": "filter",
  2. "transforms.filter.type": "io.debezium.transforms.Filter",
  3. "transforms.filter.language": "jsr223.groovy",
  4. "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:

确定