Table of Contents

Class BatchSequenceReader

Namespace
Silverback.Messaging.Sequences.Batch
Assembly
Silverback.Integration.dll

Enables the batch processing creating a BatchSequence containing the configured number of messages.

public sealed class BatchSequenceReader : SequenceReaderBase, ISequenceReader, ISorted
Inheritance
BatchSequenceReader
Implements
Inherited Members

Constructors

BatchSequenceReader()

public BatchSequenceReader()

Properties

SortIndex

Gets the sort index.

public int SortIndex { get; }

Property Value

int

Methods

CanHandleAsync(ConsumerPipelineContext)

Checks whether this reader can and must handle the message being processed in the specified context.

public override ValueTask<bool> CanHandleAsync(ConsumerPipelineContext context)

Parameters

context ConsumerPipelineContext

The current ConsumerPipelineContext.

Returns

ValueTask<bool>

A Task<TResult> representing the asynchronous operation. The task result contains a value indicating whether this reader can and must handle the message.

CreateNewSequenceCore(string, ConsumerPipelineContext)

Creates the new sequence object.

protected override ISequence CreateNewSequenceCore(string sequenceId, ConsumerPipelineContext context)

Parameters

sequenceId string

The sequence identifier.

context ConsumerPipelineContext

The current ConsumerPipelineContext.

Returns

ISequence

The new sequence.

GetExistingSequenceAsync(ConsumerPipelineContext, string)

Retrieves the existing incomplete sequence from the store.

protected override ValueTask<ISequence?> GetExistingSequenceAsync(ConsumerPipelineContext context, string sequenceId)

Parameters

context ConsumerPipelineContext

The current ConsumerPipelineContext.

sequenceId string

The sequence identifier.

Returns

ValueTask<ISequence>

The ISequence or null if not found.

GetSequenceIdAsync(ConsumerPipelineContext)

Gets the sequence identifier extracted from the current envelope.

protected override ValueTask<string> GetSequenceIdAsync(ConsumerPipelineContext context)

Parameters

context ConsumerPipelineContext

The current ConsumerPipelineContext.

Returns

ValueTask<string>

A Task<TResult> representing the asynchronous operation. The task result contains the recognized sequence identifier, or null.

IsNewSequenceAsync(string, ConsumerPipelineContext)

Determines if the current message corresponds with the beginning of a new sequence.

protected override ValueTask<bool> IsNewSequenceAsync(string sequenceId, ConsumerPipelineContext context)

Parameters

sequenceId string

The sequence identifier.

context ConsumerPipelineContext

The current ConsumerPipelineContext.

Returns

ValueTask<bool>

A Task<TResult> representing the asynchronous operation. The task result contains true if a new sequence is starting; otherwise false.