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
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
contextConsumerPipelineContextThe 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
sequenceIdstringThe sequence identifier.
contextConsumerPipelineContextThe 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
contextConsumerPipelineContextThe current ConsumerPipelineContext.
sequenceIdstringThe sequence identifier.
Returns
GetSequenceIdAsync(ConsumerPipelineContext)
Gets the sequence identifier extracted from the current envelope.
protected override ValueTask<string> GetSequenceIdAsync(ConsumerPipelineContext context)
Parameters
contextConsumerPipelineContextThe 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
sequenceIdstringThe sequence identifier.
contextConsumerPipelineContextThe current ConsumerPipelineContext.
Returns
- ValueTask<bool>
A Task<TResult> representing the asynchronous operation. The task result contains
trueif a new sequence is starting; otherwisefalse.