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
TMessageThe 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
filterFunc<IOutboundEnvelope<TMessage>, bool>The filter function. If it returns
truethe 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
filterFunc<TMessage, bool>The filter function. If it returns
truethe 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
envelopeIOutboundEnvelopeThe envelope containing the message to be filtered.
Returns
- bool
A value indicating whether the message should be produced.