简体   繁体   中英

Can Debezium Capture Changes of a Postges Materialized View

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)

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM