Add debezium-cdc module: Debezium 3.7.1 CDC from Postgres 18 to Kafka, Connect vs embedded engine vs outbox

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ic4b5uEyg58znuchZ8C8i
This commit is contained in:
asmhatre
2026-11-29 13:36:01 +05:30
co-authored by Claude Sonnet 5.5
parent e2c42dc268
commit 95e75d0101
32 changed files with 1200 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
"""Reads 'partition|key|value' lines from stdin, prints one compact line per Debezium event.
--sort-lsn : print in WAL order instead of Kafka arrival order. Partitions are read in no particular
order, so this is for display only; a tombstone takes the LSN of the delete before it.
"""
import json, sys
def short(o):
return "null" if o is None else json.dumps(o, separators=(",", ":"))
rows, last_lsn = [], {}
for line in sys.stdin:
line = line.rstrip("\n")
if not line.strip():
continue
part, key, value = line.split("|", 2)
if value == "null":
lsn = last_lsn.get(part, 0)
rows.append((lsn, 1, f"p={part} key={key} TOMBSTONE (null value)"))
continue
v = json.loads(value)
s = v["source"]
last_lsn[part] = s["lsn"]
rows.append((s["lsn"], 0, f"p={part} op={v['op']} key={key} lsn={s['lsn']} txId={s['txId']} snapshot={s['snapshot']} before={short(v['before'])} after={short(v['after'])}"))
if "--sort-lsn" in sys.argv:
rows.sort(key=lambda r: (r[0], r[1]))
for _, _, text in rows:
print(text)