Class ConsumerPipelineContext
The context that is passed along the consumer behaviors pipeline.
Implements
Inherited Members
Namespace: Silverback.Messaging.Broker.Behaviors
Assembly: Silverback.Integration.dll
Syntax
public sealed class ConsumerPipelineContext : IDisposable
Constructors
| Improve this doc View sourceConsumerPipelineContext(IRawInboundEnvelope, IConsumer, ISequenceStore, IServiceProvider)
Initializes a new instance of the ConsumerPipelineContext class.
Declaration
public ConsumerPipelineContext(IRawInboundEnvelope envelope, IConsumer consumer, ISequenceStore sequenceStore, IServiceProvider serviceProvider)
Parameters
Type | Name | Description |
---|---|---|
IRawInboundEnvelope | envelope | The envelope containing the message being processed. |
IConsumer | consumer | The IConsumer that triggered this pipeline. |
ISequenceStore | sequenceStore | The ISequenceStore used to temporary store the pending sequences being consumed. |
IServiceProvider | serviceProvider | The IServiceProvider to be used to resolve the required services. |
Properties
| Improve this doc View sourceConsumer
Gets the IConsumer that triggered this pipeline.
Declaration
public IConsumer Consumer { get; }
Property Value
Type | Description |
---|---|
IConsumer |
Envelope
Gets or sets the envelopes containing the messages being processed.
Declaration
public IRawInboundEnvelope Envelope { get; set; }
Property Value
Type | Description |
---|---|
IRawInboundEnvelope |
IsSequenceEnd
Gets a value indicating whether the current message was recognized as the end of the sequence.
Declaration
public bool IsSequenceEnd { get; }
Property Value
Type | Description |
---|---|
bool |
IsSequenceStart
Gets a value indicating whether the current message was recognized as the beginning of a new sequence.
Declaration
public bool IsSequenceStart { get; }
Property Value
Type | Description |
---|---|
bool |
ProcessingTask
Gets the Task representing the message processing when it is not directly awaited (e.g. when starting the processing of a Sequence. This Task will complete when all subscribers return.
Declaration
public Task? ProcessingTask { get; }
Property Value
Type | Description |
---|---|
Task |
Sequence
Gets a the ISequence the current message belongs to.
Declaration
public ISequence? Sequence { get; }
Property Value
Type | Description |
---|---|
ISequence |
SequenceStore
Gets the ISequenceStore used to temporary store the pending sequences being consumed.
Declaration
public ISequenceStore SequenceStore { get; }
Property Value
Type | Description |
---|---|
ISequenceStore |
ServiceProvider
Gets the IServiceProvider to be used to resolve the required services.
Declaration
public IServiceProvider ServiceProvider { get; }
Property Value
Type | Description |
---|---|
IServiceProvider |
TransactionManager
Gets the IConsumerTransactionManager that is handling the current pipeline transaction.
Declaration
public IConsumerTransactionManager TransactionManager { get; }
Property Value
Type | Description |
---|---|
IConsumerTransactionManager |
Methods
| Improve this doc View sourceDispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
GetBrokerMessageIdentifiers()
Gets the identifiers of the messages being handled in this context (either the single message or the sequence).
Declaration
public IReadOnlyCollection<IBrokerMessageIdentifier> GetBrokerMessageIdentifiers()
Returns
Type | Description |
---|---|
IReadOnlyCollection<IBrokerMessageIdentifier> | The list of identifiers. |
ReplaceServiceScope(IServiceScope)
Replaces the IServiceProvider with the one from the specified scope.
Declaration
public void ReplaceServiceScope(IServiceScope newServiceScope)
Parameters
Type | Name | Description |
---|---|---|
IServiceScope | newServiceScope | The IServiceScope to be used. |
SetIsSequenceEnd()
Sets the IsSequenceEnd property to true
, indicating that the current message was
recognized as the end of the sequence.
Declaration
public void SetIsSequenceEnd()
SetSequence(ISequence, in bool)
Sets the current sequence.
Declaration
public void SetSequence(ISequence sequence, in bool isSequenceStart)
Parameters
Type | Name | Description |
---|---|---|
ISequence | sequence | The ISequence being processed. |
bool | isSequenceStart | A value indicating whether the current message was recognized as the beginning of a new sequence. |