ExternalSource

SPI for streaming transactions into a database from an upstream feed (a CDC source, message log, etc.) instead of XTDB's own DML.

The source owns the read side of its upstream: it receives events (via polling or other methods), maps each to a transaction, and submits it through TxIndexer.executeTx.

XTDB drives the source via onPartitionAssigned and persists the per-tx ExternalSourceToken so the source can resume after the last indexed event.

Types

Link copied to clipboard
interface Factory

Opens an ExternalSource for a database, from the source config.

Link copied to clipboard

Makes a Factory persistable. A factory whose class is claimed by a ServiceLoader-discovered registration serialises (via protoTag / toProto) and so can travel as a stored secondary-database config; a programmatic factory with no registration still runs in-process, but Factory.toProto rejects it.

Functions

Link copied to clipboard
abstract fun close()
Link copied to clipboard
abstract suspend fun onPartitionAssigned(partition: Int, afterToken: ExternalSourceToken?, txIndexer: TxIndexer)

Called when partition is assigned to this node, to run the source's poll loop.