Debezium Output Topics and Event Format

This page is a reference for what a Debezium CDC connector publishes: the topic names it creates and the shape of each change event. To set a connector up in the first place, see Debezium CDC Connector (GCP Cloud SQL PostgreSQL).

Output topics and event format

Topics are named <topic.prefix>.<schema>.<table> — for example, the table
myschema.shop_order produces <stage>.<tenant>.debezium.myschema.shop_order.

Each message carries the row before and after the change:

{
  "before": { "id": 1, "status": "PENDING" },
  "after":  { "id": 1, "status": "APPROVED" },
  "op": "u",
  "ts_ms": 1750000000000,
  "source": {
    "db": "mydb", "schema": "myschema", "table": "shop_order",
    "lsn": 12345678, "txId": 99
  }
}
opEvent
cINSERT
uUPDATE
dDELETE
rSnapshot read

Keeping the connector running

With autoRestart.enabled: true a failed task restarts on its own. Omit
maxRestarts so it retries indefinitely — this is the recommended setting for
CDC, because a stopped connector leaves an inactive replication slot behind.

An inactive replication slot stops the database cleaning up its WAL, and
storage fills up over time. Always set heartbeat.interval.ms, and if the
connector will be offline for an extended period, drop the slot:

SELECT pg_drop_replication_slot('debezium_mydb');

Related articles


Did this page help you?