Class CDCClient

    • 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 use
        selectors - 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 use
        streamingPollInterval - Polling interval to mimic streaming when using @link{stream} method
        selectors - 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 use
        sessionConfigSupplier - a supplier to customise session configuration
        selectors - 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 use
        sessionConfigSupplier - a supplier to customise session configuration
        streamingPollInterval - Polling interval to mimic streaming when using @link{stream} method
        selectors - 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 use
        sessionConfigSupplier - a supplier to customise session configuration
        transactionConfigSupplier - a supplier to customise transaction configuration
        streamingPollInterval - Polling interval to mimic streaming when using @link{stream} method
        selectors - List of selectors to query changes for
        See Also:
        Selector
    • Method Detail

      • earliest

        public reactor.core.publisher.Mono<ChangeIdentifier> earliest()
        Description copied from interface: CDCService
        Returns the change identifier for the earliest available change.
        Specified by:
        earliest in interface CDCService
        Returns:
        change identifier
      • current

        public reactor.core.publisher.Mono<ChangeIdentifier> current()
        Description copied from interface: CDCService
        Returns the change identifier for the last committed transaction.
        Specified by:
        current in interface CDCService
        Returns:
        change identifier
      • query

        public reactor.core.publisher.Flux<ChangeEvent> query​(ChangeIdentifier from)
        Description copied from interface: CDCService
        Returns 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:
        query in interface CDCService
        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: CDCService
        Returns 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:
        stream in interface CDCService
        Parameters:
        from - change identifier to query changes from.
        Returns:
        change events