Memoria.Messaging.ServiceBus
2.0.0-beta
Prefix Reserved
dotnet add package Memoria.Messaging.ServiceBus --version 2.0.0-beta
NuGet\Install-Package Memoria.Messaging.ServiceBus -Version 2.0.0-beta
<PackageReference Include="Memoria.Messaging.ServiceBus" Version="2.0.0-beta" />
<PackageVersion Include="Memoria.Messaging.ServiceBus" Version="2.0.0-beta" />
<PackageReference Include="Memoria.Messaging.ServiceBus" />
paket add Memoria.Messaging.ServiceBus --version 2.0.0-beta
#r "nuget: Memoria.Messaging.ServiceBus, 2.0.0-beta"
#:package Memoria.Messaging.ServiceBus@2.0.0-beta
#addin nuget:?package=Memoria.Messaging.ServiceBus&version=2.0.0-beta&prerelease
#tool nuget:?package=Memoria.Messaging.ServiceBus&version=2.0.0-beta&prerelease
π Memoriaβ’
From Latin memoria (memory)
.NET framework implementing DDD, CQRS, and Event Sourcing.
Memoria is extremely flexible and expandable. It can be used as a simple mediator or as a full Event Sourcing solution with Cosmos DB or Entity Framework Core as storage.
- π Full documentation
- π£ Release Notes
- π Examples in repository
- π Ecommerce demo app using DCB
- π Memoria Web β browse your store
β Give a star
If you're using this repository for your learning, samples, workshop, or your project, please give a star. Thank you!
β‘Main Features
- Mediator with commands, queries, and notifications
- Two consistency models: event streams, or dynamic consistency boundaries where the boundary is a tag query chosen per decision
- Multiple aggregates per stream
- Option to store the aggregate snapshot alongside events for fast reads and write model strongly consistent
- Projections (read models) persisted and retrieved as snapshots via
SaveProjectionandGetProjection - Four different read modes that allow multiple write/read patterns based on specific needs.
- In memory aggregate and projection reconstruction up to a specific event sequence or date if provided (soon up to aggregate version)
- Events applied to the aggregate filtered by event type
- Events applied to the aggregate filtered by event property (key/value pairs declared on the aggregate id)
- Retrieval of all events applied to an aggregate
- Querying stream events from or up to a specific event sequence or date/date range
- Querying stream events filtered by event type and/or event property
- Optimistic concurrency control with an expected event sequence
- Automatic event/notification publication after a command is successfully processed that returns a list of results from all notification handlers
- Automatic event/message publication after a command is successfully processed using Service Bus or RabbitMQ
- Automatic command validation with FluentValidation if required
- Command sequences that return a list of results from all commands in the sequence
- Custom command handlers or services can be used instead of the automatically resolved command handlers
- Result pattern across handlers and providers
- Extensible architecture with providers for store, messaging, caching, and validation
- Memoria Web, a browser tool for reading a store through your own uploaded domain assemblies: the events appended, the aggregates and projections snapshotted from them and the types both were written through, with a snapshot refreshed when it falls behind and any two versions of a model compared side by side
πΊοΈ Roadmap
β Recently Completed
- Memoria Web, a browser tool that reads a store through domain assemblies uploaded to it
- Ecommerce demo application using DCB
- Dynamic consistency boundaries in their own packages, so a decision whose boundary spans more than one aggregate is expressible without serialising unrelated writes
- New
Projectionread-model base class withSaveProjection/GetProjectionsnapshot persistence across all store providers (Entity Framework Core, Npgsql, Cosmos DB, and their in-memory variants) - New PostgreSQL companion package for the Entity Framework Core store provider that makes
eventPropertyFilterwork correctly againstjsonbcolumns (uses the@>JSON-containment operator and is GIN-indexable) - New
IEventDataFilterextension point in the Entity Framework Core store provider for plugging in provider-specific JSON filter strategies - New package for in-memory Service Bus for easier testing in projects using Memoria
- New package for in-memory RabbitMQ for easier testing in projects using Memoria
- Event property filtering across aggregates and stream queries
π To Follow
- Authentication and authorization in Memoria Web, so it no longer depends on a proxy in front of it
- Option to automatically validate commands
- Event Grid messaging provider
- Kafka messaging provider
- File store provider for event sourcing
- Amazon SQS messaging provider
π£ Release Notes
π¦ Nuget Packages
π A taste of the API
Mediator
public record CreateProduct(string Name) : ICommand;
public class CreateProductHandler : ICommandHandler<CreateProduct>
{
public Task<Result> Handle(CreateProduct command) =>
Task.FromResult(Result.Ok());
}
await dispatcher.Send(new CreateProduct("Espresso"));
See the Mediator Quickstart for queries, notifications, validation, custom handlers, command sequences, and SendAndPublish.
Event Sourcing
[EventType("OrderPlaced")]
public record OrderPlaced(Guid OrderId, decimal Amount) : IEvent;
var streamId = new CustomerStreamId(customerId);
var aggregateId = new OrderAggregateId(orderId);
var order = new Order(orderId, amount: 25.45m);
await domainService.SaveAggregate(streamId, aggregateId, order, expectedEventSequence: 0);
See the Event Sourcing Quickstart for the full aggregate definition, the four read modes, multiple aggregates per stream, and in-memory replay.
π Full documentation
π Memoria Web
A browser tool for reading a Memoria store. Point it at a database, upload a zip of your own domain assemblies, and it shows you the events that were appended, the aggregates and projections snapshotted from them, and the types both were written through β both consistency models, side by side.
dotnet run --project src/Memoria.Web

Every section has a Types page, listing what the uploaded assemblies declare, and a Data page, listing what the store actually holds β filtered, sorted and paged, with all of it in the query string so a view can be bookmarked and shared.

Open a row and the aggregate is folded from its events, so you can see the state a snapshot stands at and how far behind its stream it is.

It is in the repository rather than on NuGet, so you build and run it yourself. It creates nothing and deletes nothing: the only write it offers is refreshing a snapshot that has fallen behind its stream or its boundary.
It has no authentication or authorization yet, and uploading an assembly runs code in its process. Keep it on localhost or behind a proxy that authenticates every request. Both are coming in the next release.
To try it without a domain of your own, src/Memoria.Web.Samples.Streamed and
src/Memoria.Web.Samples.Dcb carry a sample ecommerce domain modelled once in each consistency
model, and src/Memoria.Web.Samples fills a store with data written through it.
- π Memoria Web β what it is, and what each page shows
- βοΈ Configuration Β· Deployment
- π± Try it with sample data
β¨ Custom Implementations and Project Support
Memoria is designed to be extensible, supporting custom store, messaging, caching, and validation providers.
Need a specific implementation for your existing code or a new provider (e.g., a custom database store or messaging bus)? Iβve got you covered! I can also work directly on your projects to implement Memoria for your specific event sourcing or CQRS needs.
Please reach out to request custom integrations, new providers, or project assistance via LinkedIn.
π License
Memoria is dual-licensed from version 2.0.0-beta onward. Every 2.x version β alpha, beta and release alike β is offered under either of:
- the Reciprocal Public License 1.5, an OSI-approved open-source licence, if you release the source of the software you build with Memoria under the same licence, or
- the Memoria Commercial Licence, if you do not. Its Community edition is free of charge, and always will be, for companies and individuals with less than $5,000,000 USD in annual gross revenue and for registered non-profits with less than $5,000,000 USD in annual total budget. Government or quasi-government agencies do not qualify, and neither does any organisation that has ever received more than $10,000,000 USD in outside capital such as private equity or venture capital. The Standard, Professional and Enterprise editions are subscriptions at $299, $999 and $2,999 USD a year, or $29.90, $99.90 and $299.90 USD a month, half price for anyone who subscribes while 2.0.0 is in beta.
Versions 1.x remain under the Apache License 2.0. The full terms are in LICENSE.md and on the licence page.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Azure.Messaging.ServiceBus (>= 7.20.2)
- Memoria (>= 2.0.0-beta)
- Microsoft.Extensions.Options (>= 10.0.12)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.0-beta | 0 | 9/16/2026 |
| 1.9.1 | 58 | 9/13/2026 |
| 1.9.0 | 46 | 9/12/2026 |
| 1.8.0 | 109 | 9/4/2026 |
| 1.8.0-beta-2 | 85 | 9/3/2026 |
| 1.8.0-beta | 88 | 9/2/2026 |
| 1.7.0 | 101 | 8/31/2026 |
| 1.6.0 | 98 | 8/30/2026 |
| 1.5.0 | 102 | 8/29/2026 |
| 1.4.1 | 100 | 8/25/2026 |
| 1.4.0 | 99 | 8/23/2026 |
| 1.3.2 | 133 | 5/16/2026 |
| 1.3.1 | 125 | 5/13/2026 |
| 1.3.0 | 113 | 5/13/2026 |
| 1.2.1 | 124 | 5/12/2026 |
| 1.2.0 | 128 | 5/10/2026 |
| 1.1.0 | 160 | 2/1/2026 |
| 1.0.0 | 204 | 10/10/2025 |