Class RetryCountPoisonDetector
- Namespace
- Excalibur.Dispatch.ErrorHandling
- Assembly
- Excalibur.Dispatch.dll
Detects poison messages based on the number of retry attempts.
public sealed class RetryCountPoisonDetector : IPoisonMessageDetector
- Inheritance
-
RetryCountPoisonDetector
- Implements
- Inherited Members
- Extension Methods
Constructors
RetryCountPoisonDetector(IOptions<PoisonMessageOptions>)
Initializes a new instance of the RetryCountPoisonDetector class.
public RetryCountPoisonDetector(IOptions<PoisonMessageOptions> options)
Parameters
optionsIOptions<PoisonMessageOptions>The poison message configuration options.
Methods
IsPoisonMessageAsync(IDispatchMessage, IMessageContext, MessageProcessingInfo, Exception?)
Determines whether a message should be considered poison based on processing context.
public Task<PoisonDetectionResult> IsPoisonMessageAsync(IDispatchMessage message, IMessageContext context, MessageProcessingInfo processingInfo, Exception? exception = null)
Parameters
messageIDispatchMessageThe message being processed.
contextIMessageContextThe message context containing metadata.
processingInfoMessageProcessingInfoInformation about the current processing attempt.
exceptionExceptionThe exception that occurred during processing, if any.
Returns
- Task<PoisonDetectionResult>
A result indicating whether the message is poison and the reason.