Package org.neo4j.cdc.client
Class CDCClient
- java.lang.Object
-
- org.neo4j.cdc.client.CDCClient
-
- All Implemented Interfaces:
CDCService
public class CDCClient extends Object implements CDCService
DefaultCDCServiceimplementation.
-
-
Constructor Summary
Constructors Constructor Description CDCClient(org.neo4j.driver.Driver driver, Duration streamingPollInterval, Selector... selectors)Construct an instance from a driver, a poll interval and an optional list of selectors.CDCClient(org.neo4j.driver.Driver driver, Selector... selectors)Construct an instance from a driver and an optional list of selectors.CDCClient(org.neo4j.driver.Driver driver, SessionConfigSupplier sessionConfigSupplier, Duration streamingPollInterval, Selector... selectors)Construct an instance from a driver, a session config supplier, a poll interval and an optional list of selectors.CDCClient(org.neo4j.driver.Driver driver, SessionConfigSupplier sessionConfigSupplier, Selector... selectors)Construct an instance from a driver, a session config supplier and an optional list of selectors.CDCClient(org.neo4j.driver.Driver driver, SessionConfigSupplier sessionConfigSupplier, TransactionConfigSupplier transactionConfigSupplier, Duration streamingPollInterval, Selector... selectors)Construct an instance from a driver, a session config supplier, a transaction config supplier, a poll interval and an optional list of selectors.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description reactor.core.publisher.Mono<ChangeIdentifier>current()Returns the change identifier for the last committed transaction.reactor.core.publisher.Mono<ChangeIdentifier>earliest()Returns the change identifier for the earliest available change.reactor.core.publisher.Flux<ChangeEvent>query(ChangeIdentifier from)Returns the changes that happened to the database after the given change identifier.reactor.core.publisher.Flux<ChangeEvent>stream(ChangeIdentifier from)Returns the changes that happened to the database after the given change identifier.
-
-
-
Constructor Detail
-
CDCClient
public CDCClient(org.neo4j.driver.Driver driver, Selector... selectors)Construct an instance from a driver and an optional list of selectors.- Parameters:
driver- Driver instance to useselectors- List of selectors to query changes for- See Also:
Selector
-
CDCClient
public CDCClient(org.neo4j.driver.Driver driver, Duration streamingPollInterval, Selector... selectors)Construct an instance from a driver, a poll interval and an optional list of selectors.- Parameters:
driver- Driver instance to usestreamingPollInterval- Polling interval to mimic streaming when using @link{stream} methodselectors- List of selectors to query changes for- See Also:
Selector
-
CDCClient
public CDCClient(org.neo4j.driver.Driver driver, SessionConfigSupplier sessionConfigSupplier, Selector... selectors)Construct an instance from a driver, a session config supplier and an optional list of selectors.- Parameters:
driver- Driver instance to usesessionConfigSupplier- a supplier to customise session configurationselectors- List of selectors to query changes for- See Also:
Selector
-
CDCClient
public CDCClient(org.neo4j.driver.Driver driver, SessionConfigSupplier sessionConfigSupplier, Duration streamingPollInterval, Selector... selectors)Construct an instance from a driver, a session config supplier, a poll interval and an optional list of selectors.- Parameters:
driver- Driver instance to usesessionConfigSupplier- a supplier to customise session configurationstreamingPollInterval- Polling interval to mimic streaming when using @link{stream} methodselectors- List of selectors to query changes for- See Also:
Selector
-
CDCClient
public CDCClient(org.neo4j.driver.Driver driver, SessionConfigSupplier sessionConfigSupplier, TransactionConfigSupplier transactionConfigSupplier, Duration streamingPollInterval, Selector... selectors)Construct an instance from a driver, a session config supplier, a transaction config supplier, a poll interval and an optional list of selectors.- Parameters:
driver- Driver instance to usesessionConfigSupplier- a supplier to customise session configurationtransactionConfigSupplier- a supplier to customise transaction configurationstreamingPollInterval- Polling interval to mimic streaming when using @link{stream} methodselectors- List of selectors to query changes for- See Also:
Selector
-
-
Method Detail
-
earliest
public reactor.core.publisher.Mono<ChangeIdentifier> earliest()
Description copied from interface:CDCServiceReturns the change identifier for the earliest available change.- Specified by:
earliestin interfaceCDCService- Returns:
- change identifier
-
current
public reactor.core.publisher.Mono<ChangeIdentifier> current()
Description copied from interface:CDCServiceReturns the change identifier for the last committed transaction.- Specified by:
currentin interfaceCDCService- Returns:
- change identifier
-
query
public reactor.core.publisher.Flux<ChangeEvent> query(ChangeIdentifier from)
Description copied from interface:CDCServiceReturns the changes that happened to the database after the given change identifier. The returned Flux completes when we reach the end of change stream.- Specified by:
queryin interfaceCDCService- Parameters:
from- change identifier to query changes from.- Returns:
- change events
-
stream
public reactor.core.publisher.Flux<ChangeEvent> stream(ChangeIdentifier from)
Description copied from interface:CDCServiceReturns the changes that happened to the database after the given change identifier. The returned Flux does not complete, and continues querying for new changes until the Flux subscription is closed.Change Data Capture feature currently does not support streaming, and this method mimics streaming through polling.
- Specified by:
streamin interfaceCDCService- Parameters:
from- change identifier to query changes from.- Returns:
- change events
-
-