Anarchy.Toolkit.Infrastructure.Messaging.Aws 2.0.1

dotnet add package Anarchy.Toolkit.Infrastructure.Messaging.Aws --version 2.0.1
                    
NuGet\Install-Package Anarchy.Toolkit.Infrastructure.Messaging.Aws -Version 2.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Anarchy.Toolkit.Infrastructure.Messaging.Aws" Version="2.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Anarchy.Toolkit.Infrastructure.Messaging.Aws" Version="2.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Anarchy.Toolkit.Infrastructure.Messaging.Aws" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Anarchy.Toolkit.Infrastructure.Messaging.Aws --version 2.0.1
                    
#r "nuget: Anarchy.Toolkit.Infrastructure.Messaging.Aws, 2.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Anarchy.Toolkit.Infrastructure.Messaging.Aws@2.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Anarchy.Toolkit.Infrastructure.Messaging.Aws&version=2.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Anarchy.Toolkit.Infrastructure.Messaging.Aws&version=2.0.1
                    
Install as a Cake Tool

Anarchy.Toolkit.Infrastructure.Messaging.Aws

Part of Anarchy I/O Toolkit, a .NET developer platform · Pillar: Infrastructure · Layer: Infrastructure · Package catalog

AWS SNS and SQS publishers implementing the toolkit's message-broker abstractions.

dotnet add package Anarchy.Toolkit.Infrastructure.Messaging.Aws
  • Register publishers with AddSnsMessageBroker or AddSqsMessageBroker and AwsMessagingOptions, or use ModuleSnsMessageBroker and ModuleSqsMessageBroker with configuration-based options factories.
  • The package also provides shared publisher and request-builder bases, inbound mapping and compression.
  • InboundMessage.BeginCorrelationScope(logger) is the consumer entry point for correlation: it reads the correlation and attempt IDs from the mapped message's string attributes and opens the provider-neutral scope from Infrastructure.CorrelationId.
  • For integration tests, see Testing.Aws and its LocalStack helpers.

When to use it

Use this package at the composition root when application code depends on IMessageBrokerPublisher and the deployment uses SNS topics or SQS queues. It implements publishing and inbound message mapping; the application remains responsible for creating destinations, permissions and message consumption.

How to use it

Register AppTelemetry and the required broker adapters. The example uses explicit options; obtain real account and region values from your host configuration:

using Anarchy.Toolkit.Infrastructure.Messaging.Aws.Entity.Configuration.Amazon;
using Anarchy.Toolkit.Infrastructure.Messaging.Aws.Extension.Microsoft.DependencyInjection;

var options = new AwsMessagingOptions("eu-west-1", "123456789012");
services.AddSnsMessageBroker(options);
services.AddSqsMessageBroker(options);

Alternatively, register the modules with options factories using UseModule. Resolve the keyed topic or queue publisher and build messages with OutboundMessageBuilder from the abstractions package. Configure AWS credentials and permissions for the actual destinations, and plan for broker size limits, batch failures and duplicate delivery.

Consuming messages with correlation

The package maps inbound messages (InboundMessageMapper.FromSqs(sqsEvent)) but does not ship a consumer loop, so nothing propagates correlation IDs on its own: your handler opts in by opening the scope around each message.

using Anarchy.Toolkit.Infrastructure.Messaging.Aws.Extension.MessageBroker.Aws;
using Anarchy.Toolkit.Infrastructure.Messaging.Aws.Helper.MessageBroker;

foreach (var message in InboundMessageMapper.FromSqs(sqsEvent))
{
    using (message.BeginCorrelationScope(logger))
        await processor.HandleAsync(message, cancellationToken);
}

The scope sets the async-flowing CorrelationContext, opens a standard ILogger scope with the correlation and attempt properties (so every logging provider sees them) and tags the current Activity. The attribute names default to CorrelationId and AttemptId; pass other names when the publisher uses different ones. A missing attribute leaves that ID empty rather than generating one. Publishers do not add the attributes: copy CorrelationContext.CorrelationId into the outbound message attributes yourself if downstream consumers need it.

See the registration example and toolkit overview.

Releases

See the release notes for the complete release history.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Anarchy.Toolkit.Infrastructure.Messaging.Aws:

Package Downloads
Anarchy.Toolkit.Testing.Aws

AWS messaging test helpers (SNS/SQS helpers, typically against LocalStack, and SqsMessageFixture with gzip/zlib bodies) for message-broker integration tests.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.1 0 11/21/2026
2.0.0 0 11/20/2026
1.1.1 83 11/17/2026
1.1.0 87 11/17/2026
1.0.7 94 11/16/2026
1.0.6 99 11/14/2026
1.0.5 102 11/13/2026
1.0.4 97 11/9/2026
1.0.3 91 11/9/2026
1.0.1 100 11/6/2026
1.0.0 104 11/5/2026

## Releases

### 2.0.1

- chore(build): Format package release notes property

### 2.0.0

- Route publisher logs and metrics through the host's `AppTelemetry` instead of `Observer`.
- Added `InboundMessage.BeginCorrelationScope(logger)`, the consumer entry point that opens a provider-neutral correlation scope from a mapped message's attributes.

### 1.1.1

- docs(packages): identify each package's pillar and layer
- build(packages): attribute the copyright to Leandro Melão Medeiros
- build: relicense under Apache-2.0 and update the package metadata

### 1.1.0

- build(deps): upgrade Swashbuckle.AspNetCore to 11.0.1 and Microsoft.OpenApi to 3.11.1

### 1.0.7

- docs: expand XML docblocks across all projects for the DocFX API reference

### 1.0.6

- refactor(src): clean up code style across library packages
- chore(deps): update AWS SDK, Lambda ASP.NET Core server and MySqlConnector packages

### 1.0.5

- chore(deps): update AWS SDK packages

### 1.0.3

- build: migrate local automation to build tooling

### 1.0.2

- docs: expand package guides and release histories
- chore(deps): update AWS, Polly, and xUnit packages

### 1.0.1

- Added a package-specific NuGet README.

### 1.0.0

- Introduced SNS and SQS publishers, request builders, optional payload compression, inbound mapping and dependency-injection modules.