Class DbOffsetStore
Used by the Offset
An IDb
Inherited Members
Namespace: Silverback.Messaging.Inbound.ExactlyOnce .Repositories
Assembly: Silverback.Integration.dll
Syntax
public sealed class DbOffsetStore : RepositoryBase<StoredOffset>, IOffsetStore, ITransactional
Constructors
| Improve this doc View sourceDbOffsetStore(IDbContext)
Initializes a new instance of the Db
Declaration
public DbOffsetStore(IDbContext dbContext)
Parameters
Type | Name | Description |
---|---|---|
IDb |
dbContext | The IDb |
Methods
| Improve this doc View sourceCommitAsync()
Called when the message has been successfully processed to commit the transaction.
Declaration
public Task CommitAsync()
Returns
| Improve this doc View sourceGetLatestValueAsync(string, IConsumerEndpoint)
Returns the latest recorded offset value for the specified offset key and endpoint.
Declaration
public 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. |
IConsumer |
endpoint | The endpoint for which the recorded offset has to be be returned. |
Returns
Type | Description |
---|---|
Task<IBroker |
A Task<TResult> representing the asynchronous operation. The task result contains the latest offset. |
RollbackAsync()
Called when an exception occurs during the message processing to rollback the transaction.
Declaration
public Task RollbackAsync()
Returns
| Improve this doc View sourceStoreAsync(IBrokerMessageOffset, IConsumerEndpoint)
Stores the offset of the processed message.
Declaration
public Task StoreAsync(IBrokerMessageOffset offset, IConsumerEndpoint endpoint)
Parameters
Type | Name | Description |
---|---|---|
IBroker |
offset | The offset to be stored. |
IConsumer |
endpoint | The endpoint the offset belongs to. |