Skip to main content

CheckpointStore

Trait CheckpointStore 

Source
pub trait CheckpointStore: Send + Sync {
    // Required methods
    fn load(&self, subscription_id: &str) -> Result<Option<u64>>;
    fn commit(&self, subscription_id: &str, offset: u64) -> Result<()>;
}
Expand description

Pluggable store for a consumer’s last fully-processed CDC offset.

Implements Kafka-style client-managed offsets: the consumer commits the offset after a change has been processed (at-least-once). Apps may supply a custom store that persists the offset transactionally with their own sink to achieve exactly-once-sink semantics.

Required Methods§

Source

fn load(&self, subscription_id: &str) -> Result<Option<u64>>

Return the last fully-processed offset for subscription_id, or None when no checkpoint has been committed yet.

Source

fn commit(&self, subscription_id: &str, offset: u64) -> Result<()>

Durably record offset as fully processed for subscription_id.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§