Debezium可以捕获Postets物化视图的更改吗 [英] Can Debezium Capture Changes of a Postges Materialized View

查看:93
本文介绍了Debezium可以捕获Postets物化视图的更改吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们当前正在尝试使用Debezium捕获Postgres数据库中4个表的更改.目前,我们知道在此用例中,我们可以使用kafka-streams应用程序来联接/聚合KTable的表,但是我们希望保持kafka-stream拓扑简单,因此,其思想是使用来自Postgres和捕捉变化.

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源配置:

{
"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)

推荐答案

否,Debezium Postgres连接器无法捕获视图中的更改.您要么必须将联接保留在表中并捕获该表,要么必须使用Kafka Streams之类的东西来创建联接.

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.

这篇关于Debezium可以捕获Postets物化视图的更改吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆