Table of Contents

Class CompositePoisonDetector

Namespace
Excalibur.Dispatch.ErrorHandling
Assembly
Excalibur.Dispatch.dll

Composite detector that aggregates multiple poison message detectors.

public sealed class CompositePoisonDetector : IPoisonMessageDetector
Inheritance
CompositePoisonDetector
Implements
Inherited Members
Extension Methods

Constructors

CompositePoisonDetector(IEnumerable<IPoisonMessageDetector>, ILogger<CompositePoisonDetector>)

Initializes a new instance of the CompositePoisonDetector class.

public CompositePoisonDetector(IEnumerable<IPoisonMessageDetector> detectors, ILogger<CompositePoisonDetector> logger)

Parameters

detectors IEnumerable<IPoisonMessageDetector>

The collection of poison message detectors.

logger ILogger<CompositePoisonDetector>

The logger for diagnostic output.

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

message IDispatchMessage

The message being processed.

context IMessageContext

The message context containing metadata.

processingInfo MessageProcessingInfo

Information about the current processing attempt.

exception Exception

The exception that occurred during processing, if any.

Returns

Task<PoisonDetectionResult>

A result indicating whether the message is poison and the reason.