PostgresCheckpointStore
class PostgresCheckpointStore(dataSource: DataSource, dispatcher: CoroutineDispatcher = VirtualThreads.dispatcher, ddl: Ddl = Ddl.AUTO) : CheckpointStore
The CheckpointStore on PostgreSQL: one row per (group, subscription, partition) in wow_checkpoint.
A save is one autocommitted upsert whose update applies only when the new position is higher, so concurrent saves leave the highest and a lower one changes nothing. JDBC calls run on dispatcher, virtual threads by default.
Constructors
Link copied to clipboard
constructor(dataSource: DataSource, dispatcher: CoroutineDispatcher = VirtualThreads.dispatcher, ddl: Ddl = Ddl.AUTO)
Functions
Link copied to clipboard
Claims the table's format (PostgresFormat) and creates it when missing.
Link copied to clipboard
One read of the key's prefix (group, subscription), the primary key's leading columns.
Link copied to clipboard
The upserts save makes one by one, in one transaction and one commit, one WAL flush (in autocommit each upsert of a batch was a transaction of its own). A key saved twice keeps its furthest position, as one statement may touch a row once.