Class BrokerOptionsBuilder
- Namespace
- Silverback.Messaging.Configuration
- Assembly
- Silverback.Integration.dll
Exposes the methods to configure the connection with the message broker(s) and add the necessary services to the IServiceCollection.
public sealed class BrokerOptionsBuilder
- Inheritance
-
BrokerOptionsBuilder
- Inherited Members
Constructors
BrokerOptionsBuilder(SilverbackBuilder)
Initializes a new instance of the BrokerOptionsBuilder class.
public BrokerOptionsBuilder(SilverbackBuilder silverbackBuilder)
Parameters
silverbackBuilderSilverbackBuilderThe SilverbackBuilder that references the IServiceCollection to add the services to.
Properties
SilverbackBuilder
Gets the SilverbackBuilder that references the IServiceCollection to add the services to.
public SilverbackBuilder SilverbackBuilder { get; }
Property Value
Methods
AddOutboxWorker(OutboxWorkerSettings)
Adds an OutboxWorker to publish the messages stored in the outbox to the configured broker.
public BrokerOptionsBuilder AddOutboxWorker(OutboxWorkerSettings settings)
Parameters
settingsOutboxWorkerSettingsThe worker settings.
Returns
- BrokerOptionsBuilder
The BrokerOptionsBuilder so that additional calls can be chained.
AddOutboxWorker(Action<OutboxWorkerSettingsBuilder>)
Adds an OutboxWorker to publish the messages stored in the outbox to the configured broker.
public BrokerOptionsBuilder AddOutboxWorker(Action<OutboxWorkerSettingsBuilder> settingsBuilderAction)
Parameters
settingsBuilderActionAction<OutboxWorkerSettingsBuilder>An Action<T> that takes the OutboxWorkerSettingsBuilder and configures it.
Returns
- BrokerOptionsBuilder
The BrokerOptionsBuilder so that additional calls can be chained.
ConnectAfterStartup()
Specifies that the broker clients have to be connected after the application is successfully started.
public BrokerOptionsBuilder ConnectAfterStartup()
Returns
- BrokerOptionsBuilder
The BrokerOptionsBuilder so that additional calls can be chained.
ConnectAtStartup()
Specifies that the broker clients have to be connected during the application startup.
public BrokerOptionsBuilder ConnectAtStartup()
Returns
- BrokerOptionsBuilder
The BrokerOptionsBuilder so that additional calls can be chained.
DisableRetryOnConnectionFailure()
Specifies that no retry must be performed if an exception is thrown when trying to connect.
public BrokerOptionsBuilder DisableRetryOnConnectionFailure()
Returns
- BrokerOptionsBuilder
The BrokerOptionsBuilder so that additional calls can be chained.
ManuallyConnect()
Specifies that the broker clients must be initialized but not connected. They can be manually connected later.
public BrokerOptionsBuilder ManuallyConnect()
Returns
- BrokerOptionsBuilder
The BrokerOptionsBuilder so that additional calls can be chained.
RetryOnConnectionFailure(TimeSpan?)
Specifies that a retry must be performed if an exception is thrown when trying to connect.
public BrokerOptionsBuilder RetryOnConnectionFailure(TimeSpan? retryInterval = null)
Parameters
retryIntervalTimeSpan?The interval between the connection retries. The default is 5 minutes.
Returns
- BrokerOptionsBuilder
The BrokerOptionsBuilder so that additional calls can be chained.
WithConnectionOptions(BrokerClientConnectionOptions)
Specifies the BrokerClientConnectionOptions.
public BrokerOptionsBuilder WithConnectionOptions(BrokerClientConnectionOptions clientConnectionOptions)
Parameters
clientConnectionOptionsBrokerClientConnectionOptionsThe BrokerClientConnectionOptions to apply.
Returns
- BrokerOptionsBuilder
The BrokerOptionsBuilder so that additional calls can be chained.