Table of Contents

Class EndpointConfigurationBuilder<TMessage, TConfiguration, TBuilder>

Namespace
Silverback.Messaging.Configuration
Assembly
Silverback.Integration.dll
public abstract class EndpointConfigurationBuilder<TMessage, TConfiguration, TBuilder> where TConfiguration : EndpointConfiguration where TBuilder : EndpointConfigurationBuilder<TMessage, TConfiguration, TBuilder>

Type Parameters

TMessage

The type of the messages being produced or consumed.

TConfiguration

The type of the configuration being built.

TBuilder

The actual builder type.

Inheritance
EndpointConfigurationBuilder<TMessage, TConfiguration, TBuilder>
Derived
Inherited Members

Constructors

EndpointConfigurationBuilder(IServiceProvider, string?)

protected EndpointConfigurationBuilder(IServiceProvider serviceProvider, string? friendlyName)

Parameters

serviceProvider IServiceProvider

The IServiceProvider.

friendlyName string

An optional friendly to be shown in the human-targeted output (e.g. logs, health checks result, etc.).

Properties

ServiceProvider

Gets the IServiceProvider.

public IServiceProvider ServiceProvider { get; }

Property Value

IServiceProvider

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

Build()

Builds the endpoint configuration instance.

public virtual TConfiguration Build()

Returns

TConfiguration

The endpoint configuration.

CreateConfiguration()

Creates the TConfiguration instance.

protected abstract TConfiguration CreateConfiguration()

Returns

TConfiguration

The endpoint.

DisableMessageValidation()

Disables the message validation.

public TBuilder DisableMessageValidation()

Returns

TBuilder

The endpoint builder so that additional calls can be chained.

ValidateMessage(bool)

Enables the message validation.

public TBuilder ValidateMessage(bool throwException)

Parameters

throwException bool

A value that specifies whether an exception should be thrown if the message is not valid.

Returns

TBuilder

The endpoint builder so that additional calls can be chained.

ValidateMessageAndThrow()

Enables the message validation and throws an exception if the message is not valid.

public TBuilder ValidateMessageAndThrow()

Returns

TBuilder

The endpoint builder so that additional calls can be chained.

ValidateMessageAndWarn()

Enables the message validation and logs a warning if the message is not valid.

public TBuilder ValidateMessageAndWarn()

Returns

TBuilder

The endpoint builder so that additional calls can be chained.