Interface IInMemoryOutboxBuilder
Fluent builder interface for configuring in-memory outbox settings.
public interface IInMemoryOutboxBuilder
Examples
outbox.UseInMemory(inmemory =>
{
inmemory.MaxMessages(1000)
.RetentionPeriod(TimeSpan.FromHours(1));
});
Remarks
This builder configures in-memory-specific options such as capacity limits
and retention periods for testing and development scenarios.
All methods return this for method chaining.
Methods
MaxMessages(int)
Sets the maximum number of messages to retain in the in-memory store.
IInMemoryOutboxBuilder MaxMessages(int count)
Parameters
countintThe maximum message count. Zero means unlimited.
Returns
- IInMemoryOutboxBuilder
The builder for fluent chaining.
Remarks
Default is 10000. When the limit is reached, older sent messages are evicted first.
Exceptions
- ArgumentOutOfRangeException
Thrown when
countis negative.
RetentionPeriod(TimeSpan)
Sets the default retention period for sent messages.
IInMemoryOutboxBuilder RetentionPeriod(TimeSpan period)
Parameters
periodTimeSpanThe retention period. Must be positive.
Returns
- IInMemoryOutboxBuilder
The builder for fluent chaining.
Remarks
Default is 7 days. After this period, sent messages are eligible for cleanup.
Exceptions
- ArgumentOutOfRangeException
Thrown when
periodis not positive.