Skip to main content

Module resume_token

Module resume_token 

Source
Expand description

MongoDB change stream resume token persistence.

Resume tokens are opaque BSON documents that allow a change stream to be resumed from a specific position. This module provides a pluggable storage trait and two implementations:

§Resume Token Semantics

  • Track postBatchResumeToken from every getMore response, not just individual event _id fields. This prevents unnecessary oplog re-scanning across empty getMore batches.
  • On startup: if a persisted token exists, open with resumeAfter.
  • On invalidate events, switch to startAfter (cannot resumeAfter an invalidate token).

Structs§

FileResumeTokenStore
File-based resume token store for embedded and test use.
InMemoryResumeTokenStore
In-memory resume token store (no persistence, for testing).
MongoResumeTokenStore
MongoDB-backed resume token store (feature-gated behind mongodb-cdc).
ResumeToken
An opaque resume token from a MongoDB change stream.

Enums§

ResumeTokenStoreConfig
Configuration for resume token persistence.
ResumeTokenStoreError
Errors from resume token store operations.

Traits§

ResumeTokenStore
Trait for pluggable resume token persistence.