Interface IInboundMessageFilter
- Namespace
- Silverback.Messaging.Consuming.Filter
- Assembly
- Silverback.Integration.dll
Can be used to filter out the consumed messages that should not be processed.
public interface IInboundMessageFilter
Methods
ShouldProcessAsync(IInboundEnvelope, CancellationToken)
Returns a value indicating whether the specified consumed message should be processed.
ValueTask<bool> ShouldProcessAsync(IInboundEnvelope envelope, CancellationToken cancellationToken)
Parameters
envelopeIInboundEnvelopeThe envelope containing the deserialized message to be filtered.
cancellationTokenCancellationTokenA CancellationToken used to cancel the operation.
Returns
- ValueTask<bool>
A ValueTask<TResult> representing the asynchronous operation. The task result contains a value indicating whether the message should be processed.
Remarks
The messages that should not be processed are skipped: they aren't delivered to any subscriber and are committed (or acknowledged) like the messages that no subscriber handles. An exception thrown by the filter is handled by the error policy of the endpoint, like any other processing error.