You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

in-memory-storage.md 789 B

12345678910111213141516171819202122232425262728293031323334
  1. # In-Memory Storage
  2. In-memory storage is often used in development and test environments, and if you use memory-based storage you lose the reliability of local transaction messages.
  3. ## Configuration
  4. To use in-memory storage, you need to install following package from NuGet:
  5. ```powershell
  6. PM> Install-Package DotNetCore.CAP.InMemoryStorage
  7. ```
  8. Next, add configuration items to the `ConfigureServices` method of `Startup.cs`.
  9. ```csharp
  10. public void ConfigureServices(IServiceCollection services)
  11. {
  12. // ...
  13. services.AddCap(x =>
  14. {
  15. x.UseInMemoryStorage();
  16. // x.UseXXX ...
  17. });
  18. }
  19. ```
  20. CAP will clean **every 5 minutes** Successful messages in memory.
  21. ## Publish with transaction
  22. In-Memory Storage **does not support** Transaction mode to send messages.