Class InMemoryOutbox
The in-memory outbox.
Inherited Members
Namespace: Silverback.Messaging.Producing.TransactionalOutbox
Assembly: Silverback.Storage.Memory.dll
Syntax
public class InMemoryOutbox
Constructors
InMemoryOutbox()
The in-memory outbox.
Declaration
public InMemoryOutbox()
Properties
ItemsCount
Gets the number of items in the storage.
Declaration
public int ItemsCount { get; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
Add(OutboxMessage)
Adds the specified item to the storage.
Declaration
public void Add(OutboxMessage outboxMessage)
Parameters
| Type | Name | Description |
|---|---|---|
| OutboxMessage | outboxMessage | The message to add. |
Get(int)
Gets the specified number of items from the storage, starting from the oldest.
Declaration
public IReadOnlyCollection<OutboxMessage> Get(int count)
Parameters
| Type | Name | Description |
|---|---|---|
| int | count | Specifies the number of items to retrieve. |
Returns
| Type | Description |
|---|---|
| IReadOnlyCollection<OutboxMessage> | The items. |
GetMaxAge()
Gets a TimeSpan representing the time elapsed since the oldest message currently in the storage was written.
Declaration
public TimeSpan GetMaxAge()
Returns
| Type | Description |
|---|---|
| TimeSpan | The TimeSpan representing the time elapsed since the oldest message currently in the storage was written. |
Remove(IEnumerable<OutboxMessage>)
Removes the specified items from the storage.
Declaration
public void Remove(IEnumerable<OutboxMessage> outboxMessages)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<OutboxMessage> | outboxMessages | The messages to remove. |