Class SequencerConsumerBehaviorBase
Uses the available implementations of ISequenceReader to assign the incoming message to the right sequence.
Inheritance
Inherited Members
Namespace: Silverback.Messaging.Sequences
Assembly: Silverback.Integration.dll
Syntax
public abstract class SequencerConsumerBehaviorBase : IConsumerBehavior, IBrokerBehavior, ISorted
Remarks
A sequence is a set of messages that are handled as a single unit of work. A sequence could be used to group all chunks belonging to the same source message, all messages belonging to the same data set or to implement batch processing.
Constructors
| Improve this doc View sourceSequencerConsumerBehaviorBase(IEnumerable<ISequenceReader>, ISilverbackLogger<SequencerConsumerBehaviorBase>)
Initializes a new instance of the SequencerConsumerBehaviorBase class.
Declaration
protected SequencerConsumerBehaviorBase(IEnumerable<ISequenceReader> sequenceReaders, ISilverbackLogger<SequencerConsumerBehaviorBase> logger)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<ISequenceReader> | sequenceReaders | The ISequenceReader implementations to be used. |
ISilverbackLogger<SequencerConsumerBehaviorBase> | logger | The ISilverbackLogger. |
Remarks
A sequence is a set of messages that are handled as a single unit of work. A sequence could be used to group all chunks belonging to the same source message, all messages belonging to the same data set or to implement batch processing.
Properties
| Improve this doc View sourceSortIndex
Gets the sort index.
Declaration
public abstract int SortIndex { get; }
Property Value
Type | Description |
---|---|
int |
Remarks
A sequence is a set of messages that are handled as a single unit of work. A sequence could be used to group all chunks belonging to the same source message, all messages belonging to the same data set or to implement batch processing.
Methods
| Improve this doc View sourceAwaitOtherBehaviorIfNeededAsync(ISequence)
When overridden in a derived class awaits for the sequence to be processed by the other twin behavior. This is used to have the RawSequencerConsumerBehavior wait for the processing by the SequencerConsumerBehavior and it's needed to be able to properly determine the sequence end in the case where a ChunkSequence is added into another sequence (e.g. BatchSequence).
Declaration
protected virtual Task AwaitOtherBehaviorIfNeededAsync(ISequence sequence)
Parameters
Type | Name | Description |
---|---|---|
ISequence | sequence | The current sequence. |
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |
Remarks
A sequence is a set of messages that are handled as a single unit of work. A sequence could be used to group all chunks belonging to the same source message, all messages belonging to the same data set or to implement batch processing.
HandleAsync(ConsumerPipelineContext, ConsumerBehaviorHandler)
Process, handles or transforms the message being consumed.
Declaration
public virtual Task HandleAsync(ConsumerPipelineContext context, ConsumerBehaviorHandler next)
Parameters
Type | Name | Description |
---|---|---|
ConsumerPipelineContext | context | The context that is passed along the behaviors pipeline. |
ConsumerBehaviorHandler | next | The next behavior in the pipeline. |
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |
Remarks
A sequence is a set of messages that are handled as a single unit of work. A sequence could be used to group all chunks belonging to the same source message, all messages belonging to the same data set or to implement batch processing.
PublishSequenceAsync(ConsumerPipelineContext, ConsumerBehaviorHandler)
Forwards the new sequence to the next behavior in the pipeline.
Declaration
protected abstract Task PublishSequenceAsync(ConsumerPipelineContext context, ConsumerBehaviorHandler next)
Parameters
Type | Name | Description |
---|---|---|
ConsumerPipelineContext | context | The context that is passed along the behaviors pipeline. |
ConsumerBehaviorHandler | next | The next behavior in the pipeline. |
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |
Remarks
A sequence is a set of messages that are handled as a single unit of work. A sequence could be used to group all chunks belonging to the same source message, all messages belonging to the same data set or to implement batch processing.