Table of Contents

Class GenericOutboundMessageFilter<TMessage>

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

Can be used to filter the messages to be produced based on the message content.

public class GenericOutboundMessageFilter<TMessage> : IOutboundMessageFilter

Type Parameters

TMessage

The type of the messages to be filtered.

Inheritance
GenericOutboundMessageFilter<TMessage>
Implements
Inherited Members

Constructors

GenericOutboundMessageFilter(Func<IOutboundEnvelope<TMessage>, bool>)

Initializes a new instance of the GenericOutboundMessageFilter<TMessage> class.

public GenericOutboundMessageFilter(Func<IOutboundEnvelope<TMessage>, bool> filter)

Parameters

filter Func<IOutboundEnvelope<TMessage>, bool>

The filter function. If it returns true the message will be produced, otherwise it will be skipped.

GenericOutboundMessageFilter(Func<TMessage?, bool>)

Initializes a new instance of the GenericOutboundMessageFilter<TMessage> class.

public GenericOutboundMessageFilter(Func<TMessage?, bool> filter)

Parameters

filter Func<TMessage, bool>

The filter function. If it returns true the message will be produced, otherwise it will be skipped.

Methods

ShouldProduce(IOutboundEnvelope)

Returns a value indicating whether the specified message should be produced.

public bool ShouldProduce(IOutboundEnvelope envelope)

Parameters

envelope IOutboundEnvelope

The envelope containing the message to be filtered.

Returns

bool

A value indicating whether the message should be produced.