Show / Hide Table of Contents

    Class ConsumerTransactionManager

    Handles the consumer transaction. It commits or rolls back both the consumer and the enlisted transactional services (see ITransactional).

    Inheritance
    object
    ConsumerTransactionManager
    Implements
    IConsumerTransactionManager
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Silverback.Messaging.Inbound.Transaction
    Assembly: Silverback.Integration.dll
    Syntax
    public sealed class ConsumerTransactionManager : IConsumerTransactionManager

    Constructors

    | Improve this doc View source

    ConsumerTransactionManager(ConsumerPipelineContext, IInboundLogger<ConsumerTransactionManager>)

    Initializes a new instance of the ConsumerTransactionManager class.

    Declaration
    public ConsumerTransactionManager(ConsumerPipelineContext context, IInboundLogger<ConsumerTransactionManager> logger)
    Parameters
    Type Name Description
    ConsumerPipelineContext context

    The current ConsumerPipelineContext.

    IInboundLogger<ConsumerTransactionManager> logger

    The ISilverbackLogger.

    Properties

    | Improve this doc View source

    IsCompleted

    Gets a value indicating whether the transaction has completed.

    Declaration
    public bool IsCompleted { get; }
    Property Value
    Type Description
    bool

    Methods

    | Improve this doc View source

    CommitAsync()

    Commits the transaction.

    Declaration
    public Task CommitAsync()
    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    | Improve this doc View source

    Enlist(ITransactional)

    Adds the specified service to the transaction participants to be called upon commit or rollback.

    Declaration
    public void Enlist(ITransactional transactionalService)
    Parameters
    Type Name Description
    ITransactional transactionalService

    The service to be enlisted.

    | Improve this doc View source

    RollbackAsync(Exception?, bool, bool, bool)

    Aborts the transaction and causes the uncommitted changes to be rolled back.

    Declaration
    public Task<bool> RollbackAsync(Exception? exception, bool commitConsumer = false, bool throwIfAlreadyCommitted = true, bool stopConsuming = true)
    Parameters
    Type Name Description
    Exception exception

    The exception that caused the rollback.

    bool commitConsumer

    A value indicating whether the consumer have to be committed anyway. This depends on the error policy being applied.

    bool throwIfAlreadyCommitted

    A value indicating whether an exception must be thrown if the transaction was already committed.

    bool stopConsuming

    A value indicating whether the consumer must be stopped.

    Returns
    Type Description
    Task<bool>

    A Task<TResult> representing the asynchronous operation. The task result contains a value indicating whether the rollback was performed.

    Implements

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