Table of Contents

Interface IConsumerTransactionManager

Namespace
Silverback.Messaging.Consuming.Transaction
Assembly
Silverback.Integration.dll

Handles the consumer transaction.

public interface IConsumerTransactionManager

Properties

Aborted

Gets the AsyncEvent<TArg> that is after the consumer is aborted.

AsyncEvent<ConsumerPipelineContext> Aborted { get; }

Property Value

AsyncEvent<ConsumerPipelineContext>

Aborting

Gets the AsyncEvent<TArg> that is before the consumer is aborted.

AsyncEvent<ConsumerPipelineContext> Aborting { get; }

Property Value

AsyncEvent<ConsumerPipelineContext>

Committed

Gets the AsyncEvent<TArg> that is after the consumer is committed.

AsyncEvent<ConsumerPipelineContext> Committed { get; }

Property Value

AsyncEvent<ConsumerPipelineContext>

Committing

Gets the AsyncEvent<TArg> that is fired before the consumer is committed.

AsyncEvent<ConsumerPipelineContext> Committing { get; }

Property Value

AsyncEvent<ConsumerPipelineContext>

Methods

CommitAsync()

Commits the transaction.

Task CommitAsync()

Returns

Task

A Task representing the asynchronous operation.

RollbackAsync(Exception?, bool, bool, bool)

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

Task<bool> RollbackAsync(Exception? exception, bool commitConsumer = false, bool throwIfAlreadyCommitted = true, bool stopConsuming = true)

Parameters

exception Exception

The exception that caused the rollback.

commitConsumer bool

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

throwIfAlreadyCommitted bool

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

stopConsuming bool

A value indicating whether the consumer must be stopped.

Returns

Task<bool>

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