Class SequenceReaderBase
The base class for the ISequenceReader implementations. It encapsulates the logic to deal with the ISequenceStore.
Implements
Inherited Members
Namespace: Silverback.Messaging.Sequences
Assembly: Silverback.Integration.dll
Syntax
public abstract class SequenceReaderBase : ISequenceReader
Constructors
| Improve this doc View sourceSequenceReaderBase(Boolean)
Initializes a new instance of the SequenceReaderBase class.
Declaration
protected SequenceReaderBase(bool handlesRawMessages = false)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | handlesRawMessages | A value indicating whether this reader handles the raw messages, before they are being deserialized, decrypted, etc. |
Properties
| Improve this doc View sourceHandlesRawMessages
Declaration
public bool HandlesRawMessages { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
| Improve this doc View sourceCanHandleAsync(ConsumerPipelineContext)
Declaration
public abstract Task<bool> CanHandleAsync(ConsumerPipelineContext context)
Parameters
Type | Name | Description |
---|---|---|
ConsumerPipelineContext | context |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Boolean> |
CreateNewSequenceAsync(String, ConsumerPipelineContext)
Creates the new sequence and adds it to the store.
Declaration
protected virtual async Task<ISequence> CreateNewSequenceAsync(string sequenceId, ConsumerPipelineContext context)
Parameters
Type | Name | Description |
---|---|---|
System.String | sequenceId | The sequence identifier. |
ConsumerPipelineContext | context | The current ConsumerPipelineContext. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<ISequence> | The new sequence. |
CreateNewSequenceCore(String, ConsumerPipelineContext)
Creates the new sequence object.
Declaration
protected abstract ISequence CreateNewSequenceCore(string sequenceId, ConsumerPipelineContext context)
Parameters
Type | Name | Description |
---|---|---|
System.String | sequenceId | The sequence identifier. |
ConsumerPipelineContext | context | The current ConsumerPipelineContext. |
Returns
Type | Description |
---|---|
ISequence | The new sequence. |
GetExistingSequenceAsync(ConsumerPipelineContext, String)
Retrieves the existing incomplete sequence from the store.
Declaration
protected virtual Task<ISequence> GetExistingSequenceAsync(ConsumerPipelineContext context, string sequenceId)
Parameters
Type | Name | Description |
---|---|---|
ConsumerPipelineContext | context | The current ConsumerPipelineContext. |
System.String | sequenceId | The sequence identifier. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<ISequence> | The ISequence or |
GetSequenceAsync(ConsumerPipelineContext)
Declaration
public async Task<ISequence> GetSequenceAsync(ConsumerPipelineContext context)
Parameters
Type | Name | Description |
---|---|---|
ConsumerPipelineContext | context |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<ISequence> |
GetSequenceIdAsync(ConsumerPipelineContext)
Gets the sequence identifier extracted from the current envelope.
Declaration
protected virtual Task<string> GetSequenceIdAsync(ConsumerPipelineContext context)
Parameters
Type | Name | Description |
---|---|---|
ConsumerPipelineContext | context | The current ConsumerPipelineContext. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.String> | A System.Threading.Tasks.Task<TResult> representing the asynchronous operation. The task result contains
the recognized sequence identifier, or |
IsNewSequenceAsync(String, ConsumerPipelineContext)
Determines if the current message correspond with the beginning of a new sequence.
Declaration
protected abstract Task<bool> IsNewSequenceAsync(string sequenceId, ConsumerPipelineContext context)
Parameters
Type | Name | Description |
---|---|---|
System.String | sequenceId | The sequence identifier. |
ConsumerPipelineContext | context | The current ConsumerPipelineContext. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Boolean> | A System.Threading.Tasks.Task<TResult> representing the asynchronous operation. The task result contains
|