Interface IMongoDbCdcStateStore
Defines the contract for managing MongoDB CDC resume token state.
public interface IMongoDbCdcStateStore : ICdcStateStore, IAsyncDisposable, IDisposable
- Inherited Members
Remarks
Extends the shared ICdcStateStore contract with MongoDB-specific strongly-typed resume token accessors.
Methods
ClearStateAsync(string, CancellationToken)
Clears all state for a processor.
Task ClearStateAsync(string processorId, CancellationToken cancellationToken)
Parameters
processorIdstringThe unique identifier for the processor.
cancellationTokenCancellationTokenA token to observe while waiting for the task to complete.
Returns
- Task
A task representing the asynchronous operation.
GetAllStatesAsync(string, CancellationToken)
Gets detailed state information for all tracked namespaces.
Task<IReadOnlyList<MongoDbCdcStateEntry>> GetAllStatesAsync(string processorId, CancellationToken cancellationToken)
Parameters
processorIdstringThe unique identifier for the processor.
cancellationTokenCancellationTokenA token to observe while waiting for the task to complete.
Returns
- Task<IReadOnlyList<MongoDbCdcStateEntry>>
A collection of state entries.
GetLastPositionAsync(string, CancellationToken)
Gets the last processed resume token position for a processor.
Task<MongoDbCdcPosition> GetLastPositionAsync(string processorId, CancellationToken cancellationToken)
Parameters
processorIdstringThe unique identifier for the processor.
cancellationTokenCancellationTokenA token to observe while waiting for the task to complete.
Returns
- Task<MongoDbCdcPosition>
The last processed position, or Start if none exists.
SavePositionAsync(string, MongoDbCdcPosition, CancellationToken)
Saves the current resume token position for a processor.
Task SavePositionAsync(string processorId, MongoDbCdcPosition position, CancellationToken cancellationToken)
Parameters
processorIdstringThe unique identifier for the processor.
positionMongoDbCdcPositionThe position to save.
cancellationTokenCancellationTokenA token to observe while waiting for the task to complete.
Returns
- Task
A task representing the asynchronous operation.
SaveStateAsync(MongoDbCdcStateEntry, CancellationToken)
Saves detailed state for a specific namespace.
Task SaveStateAsync(MongoDbCdcStateEntry entry, CancellationToken cancellationToken)
Parameters
entryMongoDbCdcStateEntryThe state entry to save.
cancellationTokenCancellationTokenA token to observe while waiting for the task to complete.
Returns
- Task
A task representing the asynchronous operation.