Class EndpointConfigurationBuilder<TMessage, TConfiguration, TBuilder>
- Namespace
- Silverback.Messaging.Configuration
- Assembly
- Silverback.Integration.dll
Builds the EndpointConfiguration.
public abstract class EndpointConfigurationBuilder<TMessage, TConfiguration, TBuilder> where TConfiguration : EndpointConfiguration where TBuilder : EndpointConfigurationBuilder<TMessage, TConfiguration, TBuilder>
Type Parameters
TMessageThe type of the messages being produced or consumed.
TConfigurationThe type of the configuration being built.
TBuilderThe actual builder type.
- Inheritance
-
EndpointConfigurationBuilder<TMessage, TConfiguration, TBuilder>
- Derived
- Inherited Members
Constructors
EndpointConfigurationBuilder(IServiceProvider, string?)
Initializes a new instance of the EndpointConfigurationBuilder<TMessage, TConfiguration, TBuilder> class.
protected EndpointConfigurationBuilder(IServiceProvider serviceProvider, string? friendlyName)
Parameters
serviceProviderIServiceProviderThe IServiceProvider.
friendlyNamestringAn 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
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
throwExceptionboolA 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.