Class OutboxWorkerSettingsBuilder
Builds the OutboxWorkerSettings.
Inherited Members
Namespace: Silverback.Messaging.Configuration
Assembly: Silverback.Integration.dll
Syntax
public class OutboxWorkerSettingsBuilder
Constructors
OutboxWorkerSettingsBuilder()
Builds the OutboxWorkerSettings.
Declaration
public OutboxWorkerSettingsBuilder()
Methods
Build()
Builds OutboxWorkerSettings.
Declaration
public OutboxWorkerSettings Build()
Returns
| Type | Description |
|---|---|
| OutboxWorkerSettings | The OutboxWorkerSettings. |
DisableMessageOrderEnforcement()
Don't strictly enforce the message ordering, meaning that a failure in the produce of a message will cause it to be temporary skipped to try to produce the next message in the queue.
Declaration
public OutboxWorkerSettingsBuilder DisableMessageOrderEnforcement()
Returns
| Type | Description |
|---|---|
| OutboxWorkerSettingsBuilder | The OutboxWorkerSettingsBuilder so that additional calls can be chained. |
EnforceMessageOrder()
Preserve the message ordering, meaning that a failure in the produce of a message will block the whole outbox. This is the default.
Declaration
public OutboxWorkerSettingsBuilder EnforceMessageOrder()
Returns
| Type | Description |
|---|---|
| OutboxWorkerSettingsBuilder | The OutboxWorkerSettingsBuilder so that additional calls can be chained. |
ProcessOutbox(Func<OutboxSettingsBuilder, IOutboxSettingsImplementationBuilder>)
Specifies the OutboxSettings to be used by the outbox worker.
Declaration
public OutboxWorkerSettingsBuilder ProcessOutbox(Func<OutboxSettingsBuilder, IOutboxSettingsImplementationBuilder> outboxSettingsBuilderFunc)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<OutboxSettingsBuilder, IOutboxSettingsImplementationBuilder> | outboxSettingsBuilderFunc | A Func<TResult> that takes the OutboxSettingsBuilder and configures it. |
Returns
| Type | Description |
|---|---|
| OutboxWorkerSettingsBuilder | The OutboxWorkerSettingsBuilder so that additional calls can be chained. |
WithBatchSize(int)
Sets the number of messages to be retrieved from the outbox and processed at once. The default is 1000.
Declaration
public OutboxWorkerSettingsBuilder WithBatchSize(int batchSize)
Parameters
| Type | Name | Description |
|---|---|---|
| int | batchSize | The number of messages to be processed at once. |
Returns
| Type | Description |
|---|---|
| OutboxWorkerSettingsBuilder | The OutboxWorkerSettingsBuilder so that additional calls can be chained. |
WithDistributedLock(Func<DistributedLockSettingsBuilder, IDistributedLockSettingsImplementationBuilder>)
Explicitly configure the settings for the optional IDistributedLock to be used to ensure that only one instance is running at the same time. By default it will be automatically inferred from the outbox settings.
Declaration
public OutboxWorkerSettingsBuilder WithDistributedLock(Func<DistributedLockSettingsBuilder, IDistributedLockSettingsImplementationBuilder> lockSettingsBuilderFunc)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<DistributedLockSettingsBuilder, IDistributedLockSettingsImplementationBuilder> | lockSettingsBuilderFunc | A Func<TResult> that takes the DistributedLockSettingsBuilder and configures it. |
Returns
| Type | Description |
|---|---|
| OutboxWorkerSettingsBuilder | The OutboxWorkerSettingsBuilder so that additional calls can be chained. |
WithExponentialRetryDelay(TimeSpan, double, TimeSpan?)
Specifies an initial delay before the first retry and a factor to be applied to the delay at each retry.
Declaration
public OutboxWorkerSettingsBuilder WithExponentialRetryDelay(TimeSpan initialDelay, double delayFactor, TimeSpan? maxDelay = null)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | initialDelay | The initial delay before the first retry. |
| double | delayFactor | The factor to be applied at each retry. |
| TimeSpan? | maxDelay | The maximum delay to be applied. |
Returns
| Type | Description |
|---|---|
| OutboxWorkerSettingsBuilder | The OutboxWorkerSettingsBuilder so that additional calls can be chained. |
WithIncrementalRetryDelay(TimeSpan, TimeSpan, TimeSpan?)
Specifies an initial delay before the first retry and an increment to be added at each subsequent retry.
Declaration
public OutboxWorkerSettingsBuilder WithIncrementalRetryDelay(TimeSpan initialDelay, TimeSpan delayIncrement, TimeSpan? maxDelay = null)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | initialDelay | The initial delay before the first retry. |
| TimeSpan | delayIncrement | The increment to be added at each subsequent retry. |
| TimeSpan? | maxDelay | The maximum delay to be applied. |
Returns
| Type | Description |
|---|---|
| OutboxWorkerSettingsBuilder | The OutboxWorkerSettingsBuilder so that additional calls can be chained. |
WithInterval(TimeSpan)
Sets the interval between the outbox worker executions. The default is 500 milliseconds.
Declaration
public OutboxWorkerSettingsBuilder WithInterval(TimeSpan interval)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | interval | The interval between the outbox worker executions. |
Returns
| Type | Description |
|---|---|
| OutboxWorkerSettingsBuilder | The OutboxWorkerSettingsBuilder so that additional calls can be chained. |
WithoutDistributedLock()
Explicitly disable the distributed lock.
Declaration
public OutboxWorkerSettingsBuilder WithoutDistributedLock()
Returns
| Type | Description |
|---|---|
| OutboxWorkerSettingsBuilder | The OutboxWorkerSettingsBuilder so that additional calls can be chained. |