In Memory Persistence

Some scenarios require an in-memory persistence such as the development environment or a lightweight client not interested in durability across restarts:

5.x NServiceBus
var persistence = busConfiguration.UsePersistence<InMemoryPersistence>();
5.2 NServiceBus
busConfiguration.UsePersistence<InMemoryPersistence, StorageType.Sagas>();
busConfiguration.UsePersistence<InMemoryPersistence, StorageType.Subscriptions>();
busConfiguration.UsePersistence<InMemoryPersistence, StorageType.Timeouts>();
busConfiguration.UsePersistence<InMemoryPersistence, StorageType.Outbox>();
busConfiguration.UsePersistence<InMemoryPersistence, StorageType.GatewayDeduplication>();
Because there is no clustering / replication happening between NServiceBus instances, when a process is down, all the information stored in the InMemory persistence of that process is lost.
The Delayed Retries mechanism uses the deferred delivery (also known as timeouts) feature internally. As Delayed Retries is enabled by default, using InMemory persistence means the risk of losing messages that have failed processing and are waiting for another retry attempt. Use InMemory persistence only is scenarios where it is OK to lose messages.

Last modified