Show / Hide Table of Contents

    Class ErrorPolicyBase

    Builds the error policy.

    Inheritance
    object
    ErrorPolicyBase
    RetryableErrorPolicyBase
    SkipMessageErrorPolicy
    StopConsumerErrorPolicy
    Implements
    IErrorPolicy
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Silverback.Messaging.Inbound.ErrorHandling
    Assembly: Silverback.Integration.dll
    Syntax
    public abstract class ErrorPolicyBase : IErrorPolicy

    Properties

    | Improve this doc View source

    ApplyRule

    Gets the custom apply rule function.

    Declaration
    public Func<IRawInboundEnvelope, Exception, bool>? ApplyRule { get; }
    Property Value
    Type Description
    Func<IRawInboundEnvelope, Exception, bool>
    | Improve this doc View source

    ExcludedExceptions

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

    Declaration
    public ICollection<Type> ExcludedExceptions { get; }
    Property Value
    Type Description
    ICollection<Type>
    | Improve this doc View source

    IncludedExceptions

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

    Declaration
    public ICollection<Type> IncludedExceptions { get; }
    Property Value
    Type Description
    ICollection<Type>
    | Improve this doc View source

    MaxFailedAttemptsCount

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

    Declaration
    public int? MaxFailedAttemptsCount { get; }
    Property Value
    Type Description
    int?
    | Improve this doc View source

    MessageToPublishFactory

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

    Declaration
    public Func<IRawInboundEnvelope, Exception, object?>? MessageToPublishFactory { get; }
    Property Value
    Type Description
    Func<IRawInboundEnvelope, Exception, object>

    Methods

    | Improve this doc View source

    ApplyTo(Type)

    Restricts the application of this policy to the specified exception type only. It is possible to combine multiple calls to ApplyTo and Exclude.

    Declaration
    public ErrorPolicyBase ApplyTo(Type exceptionType)
    Parameters
    Type Name Description
    Type exceptionType

    The type of the exception to be handled.

    Returns
    Type Description
    ErrorPolicyBase

    The ErrorPolicyBase so that additional calls can be chained.

    | Improve this doc View source

    ApplyTo<T>()

    Restricts the application of this policy to the specified exception type only. It is possible to combine multiple calls to ApplyTo and Exclude.

    Declaration
    public ErrorPolicyBase ApplyTo<T>() where T : Exception
    Returns
    Type Description
    ErrorPolicyBase

    The ErrorPolicyBase so that additional calls can be chained.

    Type Parameters
    Name Description
    T

    The type of the exception to be handled.

    | Improve this doc View source

    ApplyWhen(Func<IRawInboundEnvelope, Exception, bool>)

    Specifies a predicate to be used to determine whether the policy has to be applied according to the current message and exception.

    Declaration
    public ErrorPolicyBase ApplyWhen(Func<IRawInboundEnvelope, Exception, bool> applyRule)
    Parameters
    Type Name Description
    Func<IRawInboundEnvelope, Exception, bool> applyRule

    The predicate.

    Returns
    Type Description
    ErrorPolicyBase

    The ErrorPolicyBase so that additional calls can be chained.

    | Improve this doc View source

    Build(IServiceProvider)

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

    Declaration
    public IErrorPolicyImplementation Build(IServiceProvider serviceProvider)
    Parameters
    Type Name Description
    IServiceProvider serviceProvider

    The IServiceProvider to be used to build the error policy.

    Returns
    Type Description
    IErrorPolicyImplementation

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

    | Improve this doc View source

    BuildCore(IServiceProvider)

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

    Declaration
    protected abstract ErrorPolicyImplementation BuildCore(IServiceProvider serviceProvider)
    Parameters
    Type Name Description
    IServiceProvider serviceProvider

    The IServiceProvider to be used to build the error policy.

    Returns
    Type Description
    ErrorPolicyImplementation

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

    | Improve this doc View source

    Exclude(Type)

    Restricts the application of this policy to all exceptions but the specified type. It is possible to combine multiple calls to ApplyTo and Exclude.

    Declaration
    public ErrorPolicyBase Exclude(Type exceptionType)
    Parameters
    Type Name Description
    Type exceptionType

    The type of the exception to be ignored.

    Returns
    Type Description
    ErrorPolicyBase

    The ErrorPolicyBase so that additional calls can be chained.

    | Improve this doc View source

    Exclude<T>()

    Restricts the application of this policy to all exceptions but the specified type. It is possible to combine multiple calls to ApplyTo and Exclude.

    Declaration
    public ErrorPolicyBase Exclude<T>() where T : Exception
    Returns
    Type Description
    ErrorPolicyBase

    The ErrorPolicyBase so that additional calls can be chained.

    Type Parameters
    Name Description
    T

    The type of the exception to be ignored.

    | Improve this doc View source

    Publish(Func<IRawInboundEnvelope, Exception, object?>)

    Specify a factory to create a message to be published to the internal bus when this policy is applied. Useful to execute some custom code.

    Declaration
    public ErrorPolicyBase Publish(Func<IRawInboundEnvelope, Exception, object?> factory)
    Parameters
    Type Name Description
    Func<IRawInboundEnvelope, Exception, object> factory

    The factory returning the message to be published.

    Returns
    Type Description
    ErrorPolicyBase

    The ErrorPolicyBase so that additional calls can be chained.

    | Improve this doc View source

    Publish(Func<IRawInboundEnvelope, object?>)

    Specify a factory to create a message to be published to the internal bus when this policy is applied. Useful to execute some custom code.

    Declaration
    public ErrorPolicyBase Publish(Func<IRawInboundEnvelope, object?> factory)
    Parameters
    Type Name Description
    Func<IRawInboundEnvelope, object> factory

    The factory returning the message to be published.

    Returns
    Type Description
    ErrorPolicyBase

    The ErrorPolicyBase so that additional calls can be chained.

    Implements

    IErrorPolicy
    • Improve this doc
    • View source
    GitHub E-Mail
    ↑ Back to top © 2020 Sergio Aquilini