Interface IOffsetStore
Used by the OffsetStoreExactlyOnceStrategy to keep track of the last processed offsets and guarantee that each message is processed only once.
Namespace: Silverback.Messaging.Inbound.ExactlyOnce.Repositories
Assembly: Silverback.Integration.dll
Syntax
public interface IOffsetStore : ITransactional
Methods
| Improve this doc View sourceGetLatestValueAsync(string, IConsumerEndpoint)
Returns the latest recorded offset value for the specified offset key and endpoint.
Declaration
Task<IBrokerMessageOffset?> GetLatestValueAsync(string offsetKey, IConsumerEndpoint endpoint)
Parameters
Type | Name | Description |
---|---|---|
string | offsetKey | The key of the offset to be retrieved. The offset key uniquely identifies the queue, topic or partition. |
IConsumerEndpoint | endpoint | The endpoint for which the recorded offset has to be be returned. |
Returns
Type | Description |
---|---|
Task<IBrokerMessageOffset> | A Task<TResult> representing the asynchronous operation. The task result contains the latest offset. |
StoreAsync(IBrokerMessageOffset, IConsumerEndpoint)
Stores the offset of the processed message.
Declaration
Task StoreAsync(IBrokerMessageOffset offset, IConsumerEndpoint endpoint)
Parameters
Type | Name | Description |
---|---|---|
IBrokerMessageOffset | offset | The offset to be stored. |
IConsumerEndpoint | endpoint | The endpoint the offset belongs to. |
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |