Skip to content

feat: add exactly once semantics for apoc based cdc handlers#504

Merged
ali-ince merged 5 commits intomainfrom
ai/add-eos-for-apoc-cdc
Feb 12, 2026
Merged

feat: add exactly once semantics for apoc based cdc handlers#504
ali-ince merged 5 commits intomainfrom
ai/add-eos-for-apoc-cdc

Conversation

@ali-ince
Copy link
Contributor

@ali-ince ali-ince commented Feb 9, 2026

This PR adds a new offset tracking mechanism to APOC based CDC sink handlers so that the database changes for every incoming message is executed only once, allowing non-idempotent changes to be handled even when delivered more than once.

This is an opt-in configuration which needs to be activated by setting neo4j.eos-offset-label configuration to a desired offset tracking label, which should also have a corresponding key constraint defined on it, i.e.

For neo4j.eos-offset-label = __KafkaOffset, the following constraint needs to be created:

CREATE CONSTRAINT kafka_offset_key FOR (n:__KafkaOffset) REQUIRE (n.strategy, n.topic, n.partition) IS KEY

@ali-ince ali-ince requested a review from a team as a code owner February 9, 2026 11:48
@fbiville fbiville self-requested a review February 9, 2026 13:45
Co-Authored-By: Florent Biville <florent.biville@neo4j.com>
Co-Authored-By: Dhru Devalia <dhru.devalia@neo4j.com>

# Conflicts:
#	sink/src/test/kotlin/org/neo4j/connectors/kafka/sink/strategy/cdc/apoc/ApocCdcSchemaHandlerTaskIT.kt
#	sink/src/test/kotlin/org/neo4j/connectors/kafka/sink/strategy/cdc/apoc/ApocCdcSourceIdHandlerTaskIT.kt
@ali-ince ali-ince force-pushed the ai/add-eos-for-apoc-cdc branch from c5e251c to 17ab4d4 Compare February 10, 2026 16:10
@neo4j-connectors
Copy link
Collaborator

neo4j-connectors commented Feb 10, 2026

</tr>
Warnings
⚠️ Commit Message 'fix: apply code review comments

Co-Authored-By: Florent Biville florent.biville@neo4j.com
Co-Authored-By: Dhru Devalia dhru.devalia@neo4j.com

Conflicts:

sink/src/test/kotlin/org/neo4j/connectors/kafka/sink/strategy/cdc/apoc/ApocCdcSchemaHandlerTaskIT.kt

sink/src/test/kotlin/org/neo4j/connectors/kafka/sink/strategy/cdc/apoc/ApocCdcSourceIdHandlerTaskIT.kt': body's lines must not be longer than 100 characters

Generated by 🚫 dangerJS against 7121990

@ali-ince ali-ince merged commit 914a08c into main Feb 12, 2026
27 checks passed
@ali-ince ali-ince deleted the ai/add-eos-for-apoc-cdc branch February 12, 2026 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants