Table of Contents

Class FilterConsumerBehavior

Namespace
Silverback.Messaging.Consuming.Filter
Assembly
Silverback.Integration.dll

Filters the consumed messages, based on the configured IInboundMessageFilter.

public class FilterConsumerBehavior : IConsumerBehavior, IBrokerBehavior, ISorted
Inheritance
FilterConsumerBehavior
Implements
Inherited Members

Remarks

The filtered messages aren't delivered to any subscriber, but they still go through the rest of the pipeline, to be committed (or acknowledged) like the messages that no subscriber handles. In a sequence (e.g. a batch), they don't count toward its length.

Constructors

FilterConsumerBehavior(ISilverbackLogger<FilterConsumerBehavior>)

Initializes a new instance of the FilterConsumerBehavior class.

public FilterConsumerBehavior(ISilverbackLogger<FilterConsumerBehavior> logger)

Parameters

logger ISilverbackLogger<FilterConsumerBehavior>

The ISilverbackLogger<TCategoryName>.

Properties

SortIndex

Gets the sort index.

public int SortIndex { get; }

Property Value

int

Methods

HandleAsync(ConsumerPipelineContext, ConsumerBehaviorHandler, CancellationToken)

Process, handles or transforms the message being consumed.

public ValueTask HandleAsync(ConsumerPipelineContext context, ConsumerBehaviorHandler next, CancellationToken cancellationToken)

Parameters

context ConsumerPipelineContext

The context that is passed along the behaviors pipeline.

next ConsumerBehaviorHandler

The next behavior in the pipeline.

cancellationToken CancellationToken

The cancellation token that can be used to cancel the operation.

Returns

ValueTask

A ValueTask representing the asynchronous operation.