Table of Contents

Class ErrorPolicyBaseBuilder<TBuilder>

Namespace
Silverback.Messaging.Configuration
Assembly
Silverback.Integration.dll

Builds an ErrorPolicyBase.

public abstract class ErrorPolicyBaseBuilder<TBuilder> where TBuilder : ErrorPolicyBaseBuilder<TBuilder>

Type Parameters

TBuilder

The actual builder type.

Inheritance
ErrorPolicyBaseBuilder<TBuilder>
Derived
Inherited Members

Constructors

ErrorPolicyBaseBuilder()

protected ErrorPolicyBaseBuilder()

Properties

This

Gets this instance.

protected abstract TBuilder This { get; }

Property Value

TBuilder

Remarks

This is necessary to work around casting in the base classes.

Methods

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.

public TBuilder ApplyTo(Type exceptionType)

Parameters

exceptionType Type

The type of the exception to be handled.

Returns

TBuilder

The policy builder so that additional calls can be chained.

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.

public TBuilder ApplyTo<T>() where T : Exception

Returns

TBuilder

The policy builder so that additional calls can be chained.

Type Parameters

T

The type of the exception to be handled.

ApplyWhen(Func<IRawInboundEnvelope, bool>)

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

public TBuilder ApplyWhen(Func<IRawInboundEnvelope, bool> applyRule)

Parameters

applyRule Func<IRawInboundEnvelope, bool>

The predicate.

Returns

TBuilder

The policy builder so that additional calls can be chained.

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.

public TBuilder ApplyWhen(Func<IRawInboundEnvelope, Exception, bool> applyRule)

Parameters

applyRule Func<IRawInboundEnvelope, Exception, bool>

The predicate.

Returns

TBuilder

The policy builder so that additional calls can be chained.

Build()

Builds the error policy instance.

public ErrorPolicyBase Build()

Returns

ErrorPolicyBase

The error policy.

BuildCore()

Builds the error policy instance.

protected abstract ErrorPolicyBase BuildCore()

Returns

ErrorPolicyBase

The error policy.

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.

public TBuilder Exclude(Type exceptionType)

Parameters

exceptionType Type

The type of the exception to be ignored.

Returns

TBuilder

The policy builder so that additional calls can be chained.

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.

public TBuilder Exclude<T>() where T : Exception

Returns

TBuilder

The policy builder so that additional calls can be chained.

Type Parameters

T

The type of the exception to be ignored.

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

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

public TBuilder Publish(Func<IRawInboundEnvelope, Exception, object?> factory)

Parameters

factory Func<IRawInboundEnvelope, Exception, object>

The factory returning the message to be published.

Returns

TBuilder

The policy builder so that additional calls can be chained.

Publish(Func<IRawInboundEnvelope, object?>)

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

public TBuilder Publish(Func<IRawInboundEnvelope, object?> factory)

Parameters

factory Func<IRawInboundEnvelope, object>

The factory returning the message to be published.

Returns

TBuilder

The policy builder so that additional calls can be chained.