Atya.Messaging.Abstractions
1.1.0
Prefix Reserved
dotnet add package Atya.Messaging.Abstractions --version 1.1.0
NuGet\Install-Package Atya.Messaging.Abstractions -Version 1.1.0
<PackageReference Include="Atya.Messaging.Abstractions" Version="1.1.0" />
<PackageVersion Include="Atya.Messaging.Abstractions" Version="1.1.0" />
<PackageReference Include="Atya.Messaging.Abstractions" />
paket add Atya.Messaging.Abstractions --version 1.1.0
#r "nuget: Atya.Messaging.Abstractions, 1.1.0"
#:package Atya.Messaging.Abstractions@1.1.0
#addin nuget:?package=Atya.Messaging.Abstractions&version=1.1.0
#tool nuget:?package=Atya.Messaging.Abstractions&version=1.1.0
Atya.Messaging.Abstractions
Transport-agnostic messaging contracts for publishers, consumers, subscriptions, and envelopes in Atya services.
Overview
Atya.Messaging.Abstractions defines the small contract layer shared by Atya messaging transports. It models message publishers, consumers, consumer registries, subscriptions, and immutable envelopes without binding applications to a broker, serializer, host, or dependency injection container.
The package intentionally does not implement a transport. Atya.Messaging.InMemory proves these contracts for tests and local development in the same release cycle.
Features
- Publisher, consumer, and consumer registry interfaces with cancellation-aware
ValueTaskmethods. - Immutable message envelopes with message id, optional correlation id, and copied headers.
- Publish options for transport-neutral metadata.
- Subscription contracts for removing registered consumers.
- No broker-client, DI, serialization, or hosting dependency.
Installation
dotnet add package Atya.Messaging.Abstractions
Install-Package Atya.Messaging.Abstractions
<PackageReference Include="Atya.Messaging.Abstractions" Version="<latest-stable>" />
Quick Start
using Atya.Messaging.Abstractions;
var envelope = MessageEnvelope.Create(
"customer.created",
new MessagePublishOptions(
messageId: "message-1",
correlationId: "correlation-1",
headers: new Dictionary<string, string>
{
["tenant"] = "acme",
}));
Console.WriteLine(envelope.MessageId);
Console.WriteLine(envelope.Message);
Console.WriteLine(envelope.CorrelationId);
Feature Tour
Implement a publisher:
using Atya.Messaging.Abstractions;
public sealed class CustomerEventPublisher(IMessagePublisher<string> publisher)
{
public ValueTask PublishAsync(string message, CancellationToken cancellationToken = default)
{
return publisher.PublishAsync(
message,
new MessagePublishOptions(correlationId: "request-123"),
cancellationToken);
}
}
Implement a consumer:
using Atya.Messaging.Abstractions;
public sealed class CustomerEventConsumer : IMessageConsumer<string>
{
public ValueTask ConsumeAsync(
MessageEnvelope<string> envelope,
CancellationToken cancellationToken = default)
{
Console.WriteLine(envelope.Message);
return ValueTask.CompletedTask;
}
}
Consumer failure semantics are transport-neutral: a normal return acknowledges handling, while an exception indicates handling failed and the transport may negatively acknowledge or redeliver the message.
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.Foundation.Abstractionskeeps this package aligned with the foundation contract layer.Atya.Foundation.Guardsprovides consistent argument validation for public entry points.
Links
- Repository: https://github.com/AtyaLibraries/Messaging.Abstractions
- NuGet: https://www.nuget.org/packages/Atya.Messaging.Abstractions
- Samples: https://github.com/AtyaLibraries/Messaging.Abstractions/tree/development/samples
- License: https://github.com/AtyaLibraries/Messaging.Abstractions/blob/development/LICENSE
| 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.Abstractions (>= 1.0.4)
- Atya.Foundation.Guards (>= 1.0.2)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Atya.Messaging.Abstractions:
| Package | Downloads |
|---|---|
|
Atya.Messaging.Outbox
Transactional outbox store and relay primitives for reliable Atya messaging. |
|
|
Atya.Messaging.InMemory
In-memory messaging transport for tests, local development, and contract validation in Atya services. |
GitHub repositories
This package is not used by any popular GitHub repositories.