Runax.Messaging.Transports.Aws.Sns
2.0.0
dotnet add package Runax.Messaging.Transports.Aws.Sns --version 2.0.0
NuGet\Install-Package Runax.Messaging.Transports.Aws.Sns -Version 2.0.0
<PackageReference Include="Runax.Messaging.Transports.Aws.Sns" Version="2.0.0" />
<PackageVersion Include="Runax.Messaging.Transports.Aws.Sns" Version="2.0.0" />
<PackageReference Include="Runax.Messaging.Transports.Aws.Sns" />
paket add Runax.Messaging.Transports.Aws.Sns --version 2.0.0
#r "nuget: Runax.Messaging.Transports.Aws.Sns, 2.0.0"
#:package Runax.Messaging.Transports.Aws.Sns@2.0.0
#addin nuget:?package=Runax.Messaging.Transports.Aws.Sns&version=2.0.0
#tool nuget:?package=Runax.Messaging.Transports.Aws.Sns&version=2.0.0
Runax.Messaging.Transports.Aws.Sns
Amazon SNS transport for Runax.Messaging. SNS is a fan-out service, so this transport publishes to SNS and consumes from an SQS queue subscribed to the topic (the standard SNS→SQS pattern).
Install
dotnet add package Runax.Messaging
dotnet add package Runax.Messaging.Transports.Aws.Sns
Register
Attach the transport to a bus with its config object:
using Runax.Messaging;
using Runax.Messaging.Transports.Aws.Sns;
builder.Services.AddRunaxMessaging(messaging =>
{
messaging.AddBus(bus =>
{
bus.AddTransport(new SnsConfig
{
Region = "us-east-1",
// consume 'orders.placed' from an SQS queue subscribed to its SNS topic
TopicQueueUrlMap =
{
["orders.placed"] = "https://sqs.us-east-1.amazonaws.com/123456789012/orders-worker",
},
});
bus.AddConsumer<OrderPlacedConsumer>();
});
});
SnsConfig lives in the Runax.Messaging.Transports.Aws.Sns namespace, so add that using.
The config is validated at startup (DataAnnotations, when the AddBus block completes); bind it
from an IConfiguration section instead of setting properties:
bus.AddTransport<SnsConfig>(builder.Configuration.GetSection("Sns")).
You provision the SNS topics, SQS queues, and the SNS→SQS subscriptions (ideally with raw message
delivery enabled). Authentication uses the default AWS credential chain unless AccessKey/SecretKey
are set.
Config
Set these directly on SnsConfig.
| Property | Meaning | Default | Required? |
|---|---|---|---|
Region |
AWS region. | us-east-1 |
No |
AccessKey / SecretKey |
Static credentials; falls back to the default credential chain. | null |
No |
ServiceUrl |
Custom endpoint, e.g. for a local emulator. | null |
No |
TopicArnMap |
Topic → SNS topic ARN for publishing. Unmapped topics are resolved via CreateTopic (idempotent). |
empty | No |
TopicQueueUrlMap |
Topic → SQS queue URL (subscribed to the topic) used to consume it. | empty | To consume a topic |
MaxNumberOfMessages |
Messages received per SQS poll (1–10). | 10 |
No |
WaitTimeSeconds |
SQS long-polling wait time (0–20). | 20 |
No |
VisibilityTimeoutSeconds |
SQS visibility timeout per receive (0–43200). | 30 |
No |
RegisterHealthCheck |
Auto-register the runax:{bus} health check (inherited from TransportConfig). |
true |
No |
Beyond the transport config, settings from the core package apply to the bus that runs this
transport — AddConsumer<T>(), WithRetry(...), OnUnroutableMessage(...),
ConfigureSerialization(...), and UseSerializer<T>() — all inside the same AddBus block.
See Configuration & per-bus settings.
Behavior
- Publish sends the serialized envelope to the topic's SNS ARN.
- Subscribe long-polls the SQS queue mapped for each topic, unwraps the SNS notification envelope
(when raw message delivery is off), and maps the dispatch verdict:
Acknowledge→DeleteMessageRequeue/DeadLetter→ leave the message for redelivery / the queue's redrive policy
For heavy fan-in consumption, consume the SQS queue directly with
Runax.Messaging.Transports.Aws.Sqs on its own
bus, which adds concurrency and visibility-extension controls.
Health check
A reachability check named runax:{bus} is registered automatically for each bus that runs
this transport (RegisterHealthCheck = false on the config to opt out).
Telemetry
The transport reports messaging.system = "aws_sns" on the spans and metrics emitted by the core
package (activity source / meter "Runax.Messaging"); the messaging.runax.bus tag identifies
the bus.
License
MIT
| 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
- AWSSDK.SimpleNotificationService (>= 4.0.100.12)
- AWSSDK.SQS (>= 4.0.100.12)
- Microsoft.Extensions.Configuration (>= 10.0.11)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.11)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.10)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.11)
- Microsoft.Extensions.Options (>= 10.0.10)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.10)
- Microsoft.Extensions.Options.DataAnnotations (>= 10.0.10)
- Runax.Messaging.Abstractions (>= 2.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.