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
originalErrorPolicyBase
Properties
ApplyRule
Gets the custom apply rule function.
public Func<IRawInboundEnvelope, Exception, bool>? ApplyRule { get; init; }
Property Value
EqualityContract
protected virtual Type EqualityContract { get; }
Property Value
ExcludedExceptions
Gets the collection of exception types this policy doesn't have to be applied to.
public IReadOnlyCollection<Type> ExcludedExceptions { get; init; }
Property Value
IncludedExceptions
Gets the collection of exception types this policy have to be applied to.
public IReadOnlyCollection<Type> IncludedExceptions { get; init; }
Property Value
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
Methods
Build(IServiceProvider)
Returns the actual error policy implementation, built using the provided IServiceProvider.
public IErrorPolicyImplementation Build(IServiceProvider serviceProvider)
Parameters
serviceProviderIServiceProviderThe 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
serviceProviderIServiceProviderThe 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
otherErrorPolicyBase
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
PrintMembers(StringBuilder)
protected virtual bool PrintMembers(StringBuilder builder)
Parameters
builderStringBuilder
Returns
ToString()
public override string ToString()
Returns
Operators
operator ==(ErrorPolicyBase?, ErrorPolicyBase?)
public static bool operator ==(ErrorPolicyBase? left, ErrorPolicyBase? right)
Parameters
leftErrorPolicyBaserightErrorPolicyBase
Returns
operator !=(ErrorPolicyBase?, ErrorPolicyBase?)
public static bool operator !=(ErrorPolicyBase? left, ErrorPolicyBase? right)
Parameters
leftErrorPolicyBaserightErrorPolicyBase