Can Debezium Capture Changes of a Postges Materialized View

醉酒当歌 提交于 2021-02-10 20:24:40

问题


We are currently trying to use Debezium for capturing changes of 4 tables in a Postgres database. We are currently aware that for this use case we could use a kafka-streams app to join/aggregate tables for a KTable, however we want to keep kafka-stream topology simple, so the idea would be to use a Materialized View from Postgres and capture it changes.

Is it possible to do this, if so than how should we configure it?

Kafka Connect Source Configuration:

{
"name": "campaign-db-source-connector",
  "config": {
    "connector.class": "io.debezium.connector.postgresql.PostgresConnector",
    "key.converter": "io.confluent.connect.avro.AvroConverter",
    "value.converter": "io.confluent.connect.avro.AvroConverter",
    "key.converter.schema.registry.url": "http://schema-registry:8081",
    "value.converter.schema.registry.url": "http://schema-registry:8081",
    "tasks.max": "1",
    "database.hostname": "campaign-db",
    "database.port": "5432",
    "database.user": "postgres",
    "database.password": "postgres",
    "database.dbname" : "campaigndb",
    "database.server.name": "campaign-db"
  }
 }

This config currently can capture all changes from individual tables but not from materialized view. (There is no topic created)


回答1:


No, the Debezium Postgres connector cannot capture changes from a view. You'd either have to persist your join in a table and capture that or indeed use something like Kafka Streams to create the join.



来源:https://stackoverflow.com/questions/58537705/can-debezium-capture-changes-of-a-postges-materialized-view

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!