Managing connector offsets
One Debezium connector on a legacy inventory table: stopped, altered forward and backward, reset, and recovered from a dropped and a lost replication slot.
Chapter 10
examples/10-managing-connector-offsets/ runs the inventory-cdc connector against a legacy inventory_item table and records every change event inventory-service receives. It accompanies Managing connector offsets.
It uses Quarkus, Camel Kafka, Hibernate ORM with Panache, Flyway, PostgreSQL, Debezium Connect and OpenTelemetry to the LGTM stack.
(cd examples/domain-model && mvn -B -q install)
cd examples/10-managing-connector-offsets
mvn -B verify
./verify.sh
What to observe
- Offsets are refused while running. PATCH and DELETE return 400 until the connector is stopped.
- A stopped connector keeps WAL. The slot goes inactive, retained bytes grow with writes to tables the connector does not capture, and resume delivers every change.
- A forward alter skips. Ten updates made while stopped never arrive; the next one does.
- A backward alter cannot rewind. Nothing older than the slot arrives, and the last change before the stop arrives once more.
- A reset re-snapshots. Exactly five
rrows with current values, no history. - A dropped slot fails the task; a lost slot does not. The first shows a trace; the second leaves the connector running with no task.
- Recovery is the same for both. Stop, drop the slot, delete the offsets, resume.
Infrastructure
Kafka, PostgreSQL, Debezium Connect and the LGTM stack from examples/_infra, a one-shot container that creates the topic, and inventory-service. The compose project is edp-10.