Atya.Messaging.InMemory
1.0.0
Prefix Reserved
dotnet add package Atya.Messaging.InMemory --version 1.0.0
NuGet\Install-Package Atya.Messaging.InMemory -Version 1.0.0
<PackageReference Include="Atya.Messaging.InMemory" Version="1.0.0" />
<PackageVersion Include="Atya.Messaging.InMemory" Version="1.0.0" />
<PackageReference Include="Atya.Messaging.InMemory" />
paket add Atya.Messaging.InMemory --version 1.0.0
#r "nuget: Atya.Messaging.InMemory, 1.0.0"
#:package Atya.Messaging.InMemory@1.0.0
#addin nuget:?package=Atya.Messaging.InMemory&version=1.0.0
#tool nuget:?package=Atya.Messaging.InMemory&version=1.0.0
Atya.Messaging.InMemory
In-memory messaging transport for tests, local development, and contract validation in Atya services.
Overview
Atya.Messaging.InMemory is a small in-process transport that implements the Atya.Messaging.Abstractions publisher and consumer registry contracts. It is intended for tests, local development, samples, and contract validation before a durable or broker-backed transport is introduced.
The bus stores accepted envelopes in memory and delivers them to subscribed consumers in registration order.
Features
InMemoryMessageBus<TMessage>implements publishing and consumer registration.DelegateMessageConsumer<TMessage>adapts a delegate to the consumer contract.- Published envelopes are retained for assertions.
- Subscriptions can be removed through
IMessageSubscription. - No broker, hosting, serializer, or dependency injection dependency.
Installation
dotnet add package Atya.Messaging.InMemory
Install-Package Atya.Messaging.InMemory
<PackageReference Include="Atya.Messaging.InMemory" Version="<latest-stable>" />
Quick Start
using Atya.Messaging.Abstractions;
using Atya.Messaging.InMemory;
var bus = new InMemoryMessageBus<string>();
await bus.SubscribeAsync(
new DelegateMessageConsumer<string>((envelope, _) =>
{
Console.WriteLine(envelope.Message);
return ValueTask.CompletedTask;
}));
await bus.PublishAsync(
"customer.created",
new MessagePublishOptions(messageId: "message-1", correlationId: "correlation-1"));
Feature Tour
Assert published messages in a test:
using Atya.Messaging.InMemory;
var bus = new InMemoryMessageBus<string>();
await bus.PublishAsync("customer.created");
Console.WriteLine(bus.PublishedMessages[0].Message);
Remove a consumer:
using Atya.Messaging.InMemory;
var bus = new InMemoryMessageBus<string>();
var subscription = await bus.SubscribeAsync(
new DelegateMessageConsumer<string>((_, _) => ValueTask.CompletedTask));
await subscription.UnsubscribeAsync();
Error Codes
This package does not define Result error codes. Invalid programmer input is rejected with standard .NET argument exceptions through Atya.Foundation.Guards.
Why These Dependencies
Atya.Messaging.Abstractionsprovides the publisher, consumer, subscription, and envelope contracts.Atya.Foundation.Guardsprovides consistent argument validation for public entry points.
Links
| 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
- Atya.Foundation.Guards (>= 1.0.2)
- Atya.Messaging.Abstractions (>= 1.0.0)
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 |
|---|---|---|
| 1.0.0 | 152 | 7/12/2026 |