Package org.neo4j.cdc.client
An internal client implementation for Neo4j Change Data Capture feature.
This is an INTERNAL library designed to be used inside official Neo4j connectors. No guarantees are made regarding API stability and support.
A minimal instance of a CDC Client for database my_db can be created using;
new CDCClient(driver, () -> SessionConfig.forDatabase("my_db"));
If you want to include some selectors so that you can filter change events, you can also provide selectors during construction.
For example, the following code block will create a CDC Client that only returns Create and Update
change events for both nodes and relationships.
new CDCClient(driver, () -> SessionConfig.forDatabase("my_db"),
EntitySelector.builder().withOperation(EntityOperation.CREATE).build(),
EntitySelector.builder().withOperation(EntityOperation.UPDATE).build());
Another example that will return changes for nodes with label Person and for relationships with type
KNOWS between Person nodes is as follows;
new CDCClient(driver, () -> SessionConfig.forDatabase("my_db"),
NodeSelector.builder().withLabels(Set.of("Person")).build(),
RelationshipSelector.builder().withType("KNOWS")
.withStart(RelationshipNodeSelector.builder().withLabels(Set.of("Person")).build())
.withEnd(RelationshipNodeSelector.builder().withLabels(Set.of("Person")).build())
.build());
-
Interface Summary Interface Description CDCService CDCServiceenables callers to track changes happening in a Neo4j database.SessionConfigSupplier The implementation can provide a session config that will be called each time before a session gets created.TransactionConfigSupplier The implementation can provide a transaction config that will be called each time before a transaction gets created. -
Class Summary Class Description CDCClient DefaultCDCServiceimplementation.ResultMapper