Table of Contents

Class ErrorPolicyBase

Namespace
Silverback.Messaging.Consuming.ErrorHandling
Assembly
Silverback.Integration.dll

Builds the error policy.

public abstract record ErrorPolicyBase : IErrorPolicy, IEquatable<ErrorPolicyBase>
Inheritance
ErrorPolicyBase
Implements
Derived
Inherited Members

Constructors

ErrorPolicyBase()

protected ErrorPolicyBase()

ErrorPolicyBase(ErrorPolicyBase)

protected ErrorPolicyBase(ErrorPolicyBase original)

Parameters

original ErrorPolicyBase

Properties

ApplyRule

Gets the custom apply rule function.

public Func<IRawInboundEnvelope, Exception, bool>? ApplyRule { get; init; }

Property Value

Func<IRawInboundEnvelope, Exception, bool>

EqualityContract

protected virtual Type EqualityContract { get; }

Property Value

Type

ExcludedExceptions

Gets the collection of exception types this policy doesn't have to be applied to.

public IReadOnlyCollection<Type> ExcludedExceptions { get; init; }

Property Value

IReadOnlyCollection<Type>

IncludedExceptions

Gets the collection of exception types this policy have to be applied to.

public IReadOnlyCollection<Type> IncludedExceptions { get; init; }

Property Value

IReadOnlyCollection<Type>

MaxFailedAttempts

Gets the number of times this policy should be applied to the same message in case of multiple failed attempts.

public int? MaxFailedAttempts { get; }

Property Value

int?

MessageToPublishFactory

Gets the factory that builds the message to be published after the policy is applied.

public Func<IRawInboundEnvelope, Exception, object?>? MessageToPublishFactory { get; init; }

Property Value

Func<IRawInboundEnvelope, Exception, object>

Methods

Build(IServiceProvider)

Returns the actual error policy implementation, built using the provided IServiceProvider.

public IErrorPolicyImplementation Build(IServiceProvider serviceProvider)

Parameters

serviceProvider IServiceProvider

The IServiceProvider to be used to build the error policy.

Returns

IErrorPolicyImplementation

An instance of IErrorPolicyImplementation that can be used to handle the processing error.

BuildCore(IServiceProvider)

Returns the actual error policy implementation, built using the provided IServiceProvider.

protected abstract ErrorPolicyImplementation BuildCore(IServiceProvider serviceProvider)

Parameters

serviceProvider IServiceProvider

The IServiceProvider to be used to build the error policy.

Returns

ErrorPolicyImplementation

An instance of IErrorPolicyImplementation that can be used to handle the processing error.

Equals(ErrorPolicyBase?)

public virtual bool Equals(ErrorPolicyBase? other)

Parameters

other ErrorPolicyBase

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

PrintMembers(StringBuilder)

protected virtual bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

ToString()

public override string ToString()

Returns

string

Operators

operator ==(ErrorPolicyBase?, ErrorPolicyBase?)

public static bool operator ==(ErrorPolicyBase? left, ErrorPolicyBase? right)

Parameters

left ErrorPolicyBase
right ErrorPolicyBase

Returns

bool

operator !=(ErrorPolicyBase?, ErrorPolicyBase?)

public static bool operator !=(ErrorPolicyBase? left, ErrorPolicyBase? right)

Parameters

left ErrorPolicyBase
right ErrorPolicyBase

Returns

bool