Show / Hide Table of Contents

    Class InMemoryOffsetStore

    Used by the OffsetStoreExactlyOnceStrategy to keep track of the last processed offsets and guarantee that each message is processed only once.

    The log is simply persisted in memory.

    Inheritance
    object
    TransactionalDictionary<string, IBrokerMessageOffset>
    InMemoryOffsetStore
    Implements
    IOffsetStore
    ITransactional
    Inherited Members
    TransactionalDictionary<string, IBrokerMessageOffset>.CommittedItemsCount
    TransactionalDictionary<string, IBrokerMessageOffset>.Items
    TransactionalDictionary<string, IBrokerMessageOffset>.UncommittedItems
    TransactionalDictionary<string, IBrokerMessageOffset>.CommitAsync()
    TransactionalDictionary<string, IBrokerMessageOffset>.RollbackAsync()
    TransactionalDictionary<string, IBrokerMessageOffset>.AddOrReplaceAsync(string, IBrokerMessageOffset)
    TransactionalDictionary<string, IBrokerMessageOffset>.RemoveAsync(string)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Silverback.Messaging.Inbound.ExactlyOnce.Repositories
    Assembly: Silverback.Integration.dll
    Syntax
    public class InMemoryOffsetStore : TransactionalDictionary<string, IBrokerMessageOffset>, IOffsetStore, ITransactional

    Constructors

    | Improve this doc View source

    InMemoryOffsetStore(TransactionalDictionarySharedItems<string, IBrokerMessageOffset>)

    Initializes a new instance of the InMemoryOffsetStore class.

    Declaration
    public InMemoryOffsetStore(TransactionalDictionarySharedItems<string, IBrokerMessageOffset> sharedItems)
    Parameters
    Type Name Description
    TransactionalDictionarySharedItems<string, IBrokerMessageOffset> sharedItems

    The offsets shared between the instances of this repository.

    Methods

    | Improve this doc View source

    GetLatestValueAsync(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.

    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.

    | Improve this doc View source

    StoreAsync(IBrokerMessageOffset, IConsumerEndpoint)

    Stores the offset of the processed message.

    Declaration
    public 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.

    Implements

    IOffsetStore
    ITransactional
    • Improve this doc
    • View source
    GitHub E-Mail
    ↑ Back to top © 2020 Sergio Aquilini