Class OnExceptionProcessor.ExceptionHandler

Assembly: redb.Route.dll

Describes a registered exception handler.

public record OnExceptionProcessor.ExceptionHandler : IEquatable<OnExceptionProcessor.ExceptionHandler>

Inheritance

Object→OnExceptionProcessor.ExceptionHandler

Implements

Properties

AllowRedeliveryWhileStopping

When false (default), redelivery stops immediately if cancellation is requested.

public bool AllowRedeliveryWhileStopping { get; init; }

Continued

Whether to continue the pipeline after handler.

public bool Continued { get; init; }

ExceptionType

Exception type to match.

public Type ExceptionType { get; init; }

Handled

Whether the exception is marked as handled (clears Exception on exchange).

public bool Handled { get; init; }

LogContinued

Whether to log the exhausted failure when the handler continued it (default: false, as in Camel).

public bool LogContinued { get; init; }

LogExhausted

Whether to log when all retries are exhausted (default: true).

public bool LogExhausted { get; init; }

LogHandled

Whether to log the exhausted failure when the handler handled it (default: false, as in Camel).

public bool LogHandled { get; init; }

LogStackTrace

Whether to include the full stack trace in retry log messages (default: true).

public bool LogStackTrace { get; init; }

MaxRedeliveries

Maximum redelivery attempts before handler fires.

public int MaxRedeliveries { get; init; }

OnExceptionOccurred

Callback invoked each time exception occurs.

public Action<IExchange>? OnExceptionOccurred { get; init; }

OnExceptionOccurredProcessor

Processor invoked every time the exception occurs, before any retry.

public IProcessor? OnExceptionOccurredProcessor { get; init; }

OnPrepareFailure

Callback invoked before the exchange is sent to the handler/DLQ after all retries are exhausted.

public Action<IExchange>? OnPrepareFailure { get; init; }

OnPrepareFailureProcessor

Processor invoked before the handler runs, once the redeliveries are exhausted.

public IProcessor? OnPrepareFailureProcessor { get; init; }

OnRedelivery

Callback invoked before each redelivery attempt (after delay).

public Action<IExchange>? OnRedelivery { get; init; }

OnRedeliveryProcessor

Processor invoked before each redelivery attempt.

public IProcessor? OnRedeliveryProcessor { get; init; }

OnWhenPredicate

Guard predicate — handler fires only when this returns true.

public Func<IExchange, bool>? OnWhenPredicate { get; init; }

Processor

Handler processor to execute.

public IProcessor Processor { get; init; }

RetriesExhaustedLogLevel

Log level when retries are exhausted.

public LogLevel RetriesExhaustedLogLevel { get; init; }

RetryAttemptedLogLevel

Log level for retry attempts.

public LogLevel RetryAttemptedLogLevel { get; init; }

RetryPolicy

Optional retry policy for controlling delays between redeliveries.

public RetryPolicy? RetryPolicy { get; init; }

RetryWhile

Predicate evaluated before each retry — continues retrying while true, regardless of max count.

public Func<IExchange, bool>? RetryWhile { get; init; }

UseOriginalBody

When true, restore only the original body (not headers) before each retry and before executing the handler.

public bool UseOriginalBody { get; init; }

UseOriginalMessage

When true, restore the original message (body + headers) before each retry and before executing the handler.

public bool UseOriginalMessage { get; init; }

Constructors