Akka.Streams.Sns
1.5.74
Prefix Reserved
dotnet add package Akka.Streams.Sns --version 1.5.74
NuGet\Install-Package Akka.Streams.Sns -Version 1.5.74
<PackageReference Include="Akka.Streams.Sns" Version="1.5.74" />
<PackageVersion Include="Akka.Streams.Sns" Version="1.5.74" />
<PackageReference Include="Akka.Streams.Sns" />
paket add Akka.Streams.Sns --version 1.5.74
#r "nuget: Akka.Streams.Sns, 1.5.74"
#:package Akka.Streams.Sns@1.5.74
#addin nuget:?package=Akka.Streams.Sns&version=1.5.74
#tool nuget:?package=Akka.Streams.Sns&version=1.5.74
Akka.Streams.Sns
Publish strings to Amazon SNS topics through Akka.NET Streams. This package uses AWSSDK.SimpleNotificationService 4.x, exposes its IAmazonSimpleNotificationService and PublishResponse types, and targets .NET Standard 2.0 and .NET 6.
dotnet add package Akka.Streams.Sns
Create a standard SNS topic and configure its subscribers separately. Set SNS_TOPIC_ARN; the examples use the AWS SDK's normal credential discovery and AWS_REGION (default us-east-1). Supply credentials or a role with permission to publish. An accepted publish does not establish that every subscriber received or processed the message.
Publish and await completion
SnsPublisher.PlainSink(topicArn, client) accepts strings and materializes a Task<Done>. The task completes after upstream finishes and all its publishes have completed. The supplied SDK client is borrowed: the connector does not dispose it. Keep it alive while the stream and any already issued SDK calls need it.
using Akka.Actor;
using Akka.Streams;
using Akka.Streams.Dsl;
using Akka.Streams.Sns;
using Amazon;
using Amazon.SimpleNotificationService;
using var client = new AmazonSimpleNotificationServiceClient(RegionEndpoint.GetBySystemName(
Environment.GetEnvironmentVariable("AWS_REGION") ?? "us-east-1"));
var topic = Environment.GetEnvironmentVariable("SNS_TOPIC_ARN")
?? throw new InvalidOperationException("Set SNS_TOPIC_ARN.");
var system = ActorSystem.Create("sns-publisher");
try
{
await Source.From(new[] { "first", "second", "third" })
.RunWith(SnsPublisher.PlainSink(topic, client), system.Materializer());
}
finally { await system.Terminate(); }
Keep each SDK response
SnsPublisher.PlainFlow(topicArn, client) accepts strings, emits the corresponding SDK PublishResponse, and materializes NotUsed. Responses are emitted in input order, with one publish in flight at a time. The final response is followed by completion without requiring another downstream request.
using Akka.Actor;
using Akka.Streams;
using Akka.Streams.Dsl;
using Akka.Streams.Sns;
using Amazon;
using Amazon.SimpleNotificationService;
using Amazon.SimpleNotificationService.Model;
using var client = new AmazonSimpleNotificationServiceClient(RegionEndpoint.GetBySystemName(
Environment.GetEnvironmentVariable("AWS_REGION") ?? "us-east-1"));
var topic = Environment.GetEnvironmentVariable("SNS_TOPIC_ARN")
?? throw new InvalidOperationException("Set SNS_TOPIC_ARN.");
var system = ActorSystem.Create("sns-responses");
try
{
var responses = await Source.From(new[] { "first", "second", "third" })
.Via(SnsPublisher.PlainFlow(topic, client))
.RunWith(Sink.Seq<PublishResponse>(), system.Materializer());
foreach (var response in responses)
Console.WriteLine(response.MessageId);
}
finally { await system.Terminate(); }
The connector sends each input as the Message of an SNS PublishRequest with the supplied topic ARN. It does not expose subject, message attributes, message structure, FIFO group/deduplication IDs or batching options. Use the SDK directly when those request features are required. Subscription protocol, raw-message delivery and subscriber permissions are configured on SNS/SQS, not by these stages. An SQS subscriber normally receives an SNS JSON envelope; a raw-message subscription receives the payload directly.
Stream backpressure controls publication, while upstream/downstream stages may still buffer data. Standard SNS delivery and SDK/application retries can produce duplicates; this connector does not add exactly-once processing, persistence or a subscriber acknowledgment protocol. Retrying after a failure can repeat a publish whose outcome was uncertain.
SDK failures fail the stream. A faulted SDK task retains its AggregateException wrapper; inspect GetBaseException() for the service error. A canceled SDK publish fails with TaskCanceledException, rather than reporting successful stream completion. Upstream failures also fail the stage. Stream cancellation does not cancel a publish already issued to the SDK; configure bounded SDK timeouts and manage the borrowed client's lifetime. This stage does not implement a retry or supervision policy of its own.
Tests
With Docker running, from the repository root:
dotnet test src/AWS/SNS/Akka.Streams.Sns.Tests/Akka.Streams.Sns.Tests.csproj -c Release --framework net10.0
dotnet test src/AWS/SNS/Akka.Streams.Sns.IntegrationTests/Akka.Streams.Sns.IntegrationTests.csproj -c Release
The existing test project retains its net10.0/net48 targets and tests the publication, demand, failure and canceled-task contracts. The separate .NET 10 integration project uses Testcontainers.Floci and pinned floci/floci:1.5.13, discovered endpoints, owned resources and bounded startup/cleanup. Native SQS subscriptions verify exact wrapped/raw payloads, SNS response IDs for wrapped delivery, sink completion, SDK errors and borrowed-client usability. Setup failures fail the suite.
The observer process uses SQS/Core SDK 4.1 with the SNS 4.0 client. The shipped library and original contracts retain their SNS/Core 4.0 minimum graph; the separate SQS connector keeps its SDK 3 dependency. These standard-topic emulator tests do not establish AWS IAM/KMS enforcement, FIFO behavior, production consistency, subscriber processing or durability across failures.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Akka.Streams (>= 1.5.74)
- AWSSDK.SimpleNotificationService (>= 4.0.0)
-
net6.0
- Akka.Streams (>= 1.5.74)
- AWSSDK.SimpleNotificationService (>= 4.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Akka.Streams.Sns:
| Package | Downloads |
|---|---|
|
MJ.Akka.EventReactor.SNS
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.5.74 | 102 | 11/13/2026 |
| 1.5.59 | 1,005 | 1/27/2026 |
| 1.5.57 | 843 | 12/23/2025 |
| 1.5.40 | 1,689 | 4/18/2025 |
| 1.5.37 | 1,645 | 1/23/2025 |
| 1.5.33 | 1,631 | 12/26/2024 |
| 1.5.28 | 1,646 | 9/9/2024 |
| 1.5.18 | 1,658 | 3/29/2024 |
| 1.5.15 | 1,707 | 1/11/2024 |
| 1.5.8 | 1,809 | 6/30/2023 |
| 1.5.7 | 1,776 | 5/31/2023 |
| 1.5.0.1 | 1,854 | 3/7/2023 |
| 1.5.0 | 1,817 | 3/3/2023 |
| 1.4.49 | 1,833 | 3/3/2023 |
| 1.0.1-beta4 | 691 | 10/21/2022 |
| 1.0.1-beta3 | 311 | 10/21/2022 |
| 1.0.1-beta2 | 344 | 7/25/2022 |
| 1.0.1-beta1 | 344 | 6/8/2022 |
| 1.0.0-beta9 | 386 | 3/17/2022 |
| 1.0.0-beta8 | 379 | 12/21/2021 |
* Bump the minimum Akka.NET dependency to [1.5.74](https://github.com/akkadotnet/akka.net/releases/tag/1.5.74), with aligned Streams and TestKit dependencies.
* Include an individual README in each of the twelve connector packages, with usage, ownership, delivery semantics, limitations and linked NuGet version/download badges. Expand the repository README and documentation navigation.
* Update compatible Azure, AWS, AMQP and SignalR dependencies. Package READMEs document remaining SDK support and version limitations.
* Azure Service Bus JSON sources await successful message completion before emitting values and propagate settlement failures.
* Fix SQS batch-response correlation when response entries arrive in a different order.
* Improve SNS and Kinesis completion, cancellation and failure handling.
* Remove blocking SignalR send waits while preserving sequential delivery and existing materialized values.
* Propagate AMQP conversion and connection failures through the materialized completion task.
* Correct CSV parsing across split CRLF/escape sequences and XML parser empty-element/document completion, including reader and feeder cleanup.
* Improve rotating-file sink cleanup on completion and failures.
* Add required service integration, package/API, unchanged-consumer and packaged-example validation. Harden Event Hubs startup and Service Bus polling tests.
* Replace legacy FluentAssertions usages with xUnit assertions, retaining their payload, ordering, exception and deadline checks.
* Mark the historical `Akka.Streams.Channels`, `Akka.Streams.Azure.EventHub.V5` and `Akka.Streams.SignalR.AspNetCore` packages as Legacy on NuGet. See the [migration guide](https://alpakka.getakka.net/documentation/LegacyPackages.html) for their maintained replacements and compatibility requirements.
**Upstream compatibility:** Alpakka retains its public APIs and library targets. Raising the Akka.NET minimum from 1.5.60 inherits upstream binary changes: the old `RetrySupport.Retry` overload with an `int randomFactor` is replaced by a `double` overload, and `ISourceQueue<T>` requires `OfferAsync(T, CancellationToken)`. Applications using that old compiled overload or custom queue implementations need to update and rebuild against the new dependencies.