debezium.encode: logical messages (op: m) and extended.headers.enabled are not implemented

Aperta
#3,384 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
38/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go, json, kafka, postgresql

Direzione di ricerca

Start at pkg/plugin/processor/builtin/impl/debezium/plan.go, where the op switch handles c, r, u, d but not m; use schema.go and json.go to see how the envelope and JsonConverter are built. For headers, search the processor for where the Debezium envelope is assembled and add the extended.headers.enabled path plus __debezium.context.* fields. Extend json_test.go and compare against goldens in tests/debezium/testdata/golden/<version>/<converter>/; done means both the logical-message path and context headers are covered and match real Debezium output.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

debezium.encode (#3183) shipped the envelope, naming, tombstone and JsonConverter work for the Debezium-compatible output mode. It was written directly rather than taken from #3076, which was opened earlier as "the core of debezium.encode" and is now closed as superseded.

Two things #3076 covered are not on main, and both belong to the v0.23 output mode rather than to the v0.22 groundwork. This issue is the record so they are not lost with the closed PR.

1. Logical messages (op: m)

pkg/plugin/processor/builtin/impl/debezium/plan.go handles c, r, u, d and the primary-key change (delete, tombstone, create). It has no m case. Debezium emits a logical message on <prefix>.message for pg_logical_emit_message, with its own schema and no key. #3076's builder produced it.

Decide, when the output mode lands, whether to support m or to refuse it with a stable code. Refusing silently is not an option: a logical message reaching the processor today falls through the switch, and the behavior on that path needs a test either way.

2. extended.headers.enabled and the __debezium.context.* headers

Nothing in the tree mentions extended.headers or __debezium.context. Debezium 2.6+ can attach connector-context headers to every message, and a consumer configured against a real Debezium connector with that setting on will see them missing from Conduit's output. #3076 added the setting and the headers.

Not worth carrying over

  • tests/debezium/oracle/ — a Java Oracle.java generating TSV expectations per Kafka Connect version (2.7.4, 3.7.0). main has something better from #3075: tests/debezium/ captures real Debezium output into committed goldens (tests/debezium/testdata/golden/<version>/<converter>/), which is what debezium.encode's json_test.go and the debezium-golden workflow compare against. The TSV oracle was an earlier approach to the same problem.
  • connect/ as a separate reusable package. main implements the same Connect schema model and JsonConverter port unexported inside pkg/plugin/processor/builtin/impl/debezium (schema.go: schema, field, parameter, descriptor; json.go: writeValue, the Decimal and VariableScaleDecimal encodings, Jackson string escaping, Java Double/Float.toString, javaBigIntBytes). If the MySQL output mode needs to share it, extracting main's version is the move, not resurrecting a parallel one.

Where this lands

The v0.23 roadmap item is "Debezium-compatible output mode for MySQL, using the Postgres diff harness from v0.21 (#3075) against real Debezium on the same database". Both gaps above are Postgres-side and should close before or with that work.

The closed branch is feat/debezium-envelope-json at 6940619 if any of it is wanted verbatim.

Lingua principale
Go
Stelle
617
Fork
69
Merge medio
8h 5m
PR unite (30g)
122

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ConduitIO/conduit

Tutte le issue di ConduitIO/conduit

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.