{"id":50494181,"url":"https://github.com/anusikh/cdc-impl","last_synced_at":"2026-06-02T05:30:51.831Z","repository":{"id":349599260,"uuid":"1196695775","full_name":"anusikh/cdc-impl","owner":"anusikh","description":"implementation of change data capture from Postgres using Debezium Kafka Connect","archived":false,"fork":false,"pushed_at":"2026-04-06T17:11:30.000Z","size":28,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-06T19:14:05.068Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anusikh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-31T00:29:27.000Z","updated_at":"2026-04-06T17:11:35.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/anusikh/cdc-impl","commit_stats":null,"previous_names":["anusikh/cdc-impl"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/anusikh/cdc-impl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anusikh%2Fcdc-impl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anusikh%2Fcdc-impl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anusikh%2Fcdc-impl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anusikh%2Fcdc-impl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anusikh","download_url":"https://codeload.github.com/anusikh/cdc-impl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anusikh%2Fcdc-impl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33808702,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-02T02:00:07.132Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-02T05:30:50.418Z","updated_at":"2026-06-02T05:30:51.822Z","avatar_url":"https://github.com/anusikh.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"## quick start (auto connector registration)\n\nThat script:\n- runs `docker compose -f infra/docker-compose.yml up -d`\n- waits for Kafka and Kafka Connect\n- creates DLQ topics\n- idempotently PUTs the `postgres-connector` config from `infra/connector-configs/postgres-connector.json`\n\n```bash\n# create consumer to check if connect is sending CDC events\ndocker exec -it infra-kafka-1 /kafka/bin/kafka-console-consumer.sh \\\n  --bootstrap-server infra-kafka-1:9092 \\\n  --topic dbserver1.public.users \\\n  --from-beginning\n\n# inspect the connect DLQ\ndocker exec -it infra-kafka-1 /kafka/bin/kafka-console-consumer.sh \\\n  --bootstrap-server infra-kafka-1:9092 \\\n  --topic cdc.dlq.connect \\\n  --from-beginning\n\n# inspect the app DLQ\ndocker exec -it infra-kafka-1 /kafka/bin/kafka-console-consumer.sh \\\n  --bootstrap-server infra-kafka-1:9092 \\\n  --topic cdc.dlq.app \\\n  --from-beginning\n\n# insert into table\ndocker exec -it postgres-cdc psql -U postgres -d postgres -c \\\n  \"INSERT INTO users (full_name, email) VALUES ('Test User', 'test@example.com');\"\n\n# perform search\ncurl -X GET \"localhost:9200/cdc_events/_search?pretty\" -H 'Content-Type: application/json' -d'\n{\n  \"query\": {\n    \"match\": {\n      \"after.full_name\": {\n        \"query\": \"Test User\",\n        \"fuzziness\": \"AUTO\"\n      }\n    }\n  }\n}'\n```\n\n# get config\ncurl http://localhost:8083/connectors/postgres-connector/config\n\n## verify app DLQ\n\nUse this to verify the Spring consumer sends malformed records to `cdc.dlq.app`.\n\n1. start the infra stack\n\n```bash\ndocker compose -f infra/docker-compose.yml up -d\n```\n\n2. start the sink app\n\n```bash\ncd cdcink\n./mvnw spring-boot:run\n```\n\n3. publish a malformed Debezium-style event to the source topic\n   - this payload is intentionally missing `payload.source.db` and `payload.source.table`\n   - `DebeziumKafkaConsumer.validateEnvelope(...)` should reject it\n\n```bash\ndocker exec -i infra-kafka-1 /kafka/bin/kafka-console-producer.sh \\\n  --bootstrap-server kafka:9092 \\\n  --topic dbserver1.public.users \\\n  --property parse.key=true \\\n  --property key.separator='|' \u003c\u003c'EOF'\nreadme-check-key|{\"payload\":{\"op\":\"c\",\"ts_ms\":1712419201000,\"after\":{\"id\":2001,\"full_name\":\"README Check\",\"email\":\"readme@test.local\"},\"source\":{\"schema\":\"public\"}}}\nEOF\n```\n\n4. read the app DLQ with headers enabled\n\n```bash\ndocker exec infra-kafka-1 /kafka/bin/kafka-console-consumer.sh \\\n  --bootstrap-server kafka:9092 \\\n  --topic cdc.dlq.app \\\n  --from-beginning \\\n  --max-messages 5 \\\n  --timeout-ms 5000 \\\n  --property print.key=true \\\n  --property print.headers=true\n```\n\nExpected result:\n- the record appears on `cdc.dlq.app`\n- the key is preserved\n- Spring adds `kafka_dlt_*` headers\n- the app adds:\n  - `dlq.source=app`\n  - `dlq.error=com.anusikh.cdcink.service.exception.NonRetryableCdcException`\n  - `dlq.error-message=Missing Debezium source metadata for topic dbserver1.public.users`\n  - `dlq.original-topic=dbserver1.public.users`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanusikh%2Fcdc-impl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanusikh%2Fcdc-impl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanusikh%2Fcdc-impl/lists"}