Hi Team,
My CDC Pipeline: POSTGRES_SOURCE-->DEBEZIUM-->KAFKA-->POSTGRES_TARGET.
I have tried DML operations with below Source and Sink connectors, These are the results.
Create Table at source - it's creating in the target
Inserting Records - it's inserting the records
Update Records - it's updating the records
Delete Records - Not deleting the rows but adding an extra '__deleted' column in target and value 'true'. Initially it was 'false' for every table.
-But I am expecting a deletion of the row at the target when I delete at the source. Can you help me with this?Source-Connector
===============
{
"name": "postgres-source-connector",
"config": {
"connector.class": "io.debezium.connector.postgresql.PostgresConnector",
"tasks.max": "1",
"database.hostname": "postgres_source",
"database.port": "5432",
"database.user": "postgres",
"database.password": "postgres",
"database.dbname": "sourcedb",
"
database.server.name": "pgserver1",
"
plugin.name": "pgoutput",
"
slot.name": "debezium_slot",
"
publication.name": "dbz_publication",
"table.include.list": ".*",
"tombstones.on.delete": "true",
"transforms": "unwrap",
"transforms.unwrap.type": "io.debezium.transforms.ExtractNewRecordState",
"transforms.unwrap.drop.tombstones": "true",
"transforms.unwrap.delete.handling.mode": "rewrite",
"include.schema.changes": "true",
"topic.prefix": "dbz"
}
}
Sink Connector
=============
{
"name": "postgres-sink-connector",
"config": {
"connector.class": "io.debezium.connector.jdbc.JdbcSinkConnector",
"tasks.max": "1",
"connection.url": "jdbc:postgresql://postgres_target:5432/targetdb",
"connection.username": "postgres",
"connection.password": "postgres",
"insert.mode": "upsert",
"primary.key.mode": "record_key",
"topics": "dbz.public.users",
"delete.enabled": "true",
"value.converter": "org.apache.kafka.connect.json.JsonConverter",
"value.converter.schemas.enable": "true",
"key.converter": "org.apache.kafka.connect.json.JsonConverter",
"key.converter.schemas.enable": "true",
"schema.evolution": "basic",
"use.time.zone": "UTC"
}
}
Thanks and Regards
Damodar