Akka.Streams.SQS
1.5.74
Prefix Reserved
dotnet add package Akka.Streams.SQS --version 1.5.74
NuGet\Install-Package Akka.Streams.SQS -Version 1.5.74
<PackageReference Include="Akka.Streams.SQS" Version="1.5.74" />
<PackageVersion Include="Akka.Streams.SQS" Version="1.5.74" />
<PackageReference Include="Akka.Streams.SQS" />
paket add Akka.Streams.SQS --version 1.5.74
#r "nuget: Akka.Streams.SQS, 1.5.74"
#:package Akka.Streams.SQS@1.5.74
#addin nuget:?package=Akka.Streams.SQS&version=1.5.74
#tool nuget:?package=Akka.Streams.SQS&version=1.5.74
Akka.Streams.SQS
Amazon SQS publishing, receiving and acknowledgment stages for Akka.NET Streams. This package uses AWSSDK.SQS 3.x, exposes its public request/response types, and targets .NET Standard 2.0 and .NET 6. SDK 4 is not a drop-in replacement for those public driver contracts.
AWS SDK for .NET v3 reached end of support on June 1, 2026; AWS does not plan further v3 updates, including security fixes. This adapter retains its existing v3 contracts for compatibility. Updating this package does not restore vendor support for the SDK.
dotnet add package Akka.Streams.SQS
Create the queue separately and set SQS_QUEUE_URL. The examples use the AWS SDK's normal credential discovery and AWS_REGION (default us-east-1); configure credentials or a role with the required queue permissions. For a local emulator, configure an AmazonSQSClient with its discovered AmazonSQSConfig.ServiceURL, AuthenticationRegion and test credentials instead.
Publish messages
SqsPublishSink.Default accepts strings and returns a Task<Done> that completes after the sends finish. Its supplied IAmazonSQS is borrowed; keep it alive for the stream and dispose it afterwards.
using Akka.Actor;
using Akka.Streams;
using Akka.Streams.Dsl;
using Akka.Streams.SQS;
using Amazon;
using Amazon.SQS;
using var client = new AmazonSQSClient(RegionEndpoint.GetBySystemName(
Environment.GetEnvironmentVariable("AWS_REGION") ?? "us-east-1"));
var queueUrl = Environment.GetEnvironmentVariable("SQS_QUEUE_URL")
?? throw new InvalidOperationException("Set SQS_QUEUE_URL.");
var system = ActorSystem.Create("sqs-publisher");
try
{
await Source.From(new[] { "first", "second", "third" })
.RunWith(SqsPublishSink.Default(client, queueUrl), system.Materializer());
}
finally { await system.Terminate(); }
The publishing APIs offer three modes:
| API | Input | Result |
|---|---|---|
SqsPublishFlow.Default |
SendMessageRequest |
SqsPublishResult with the original request and SDK response |
SqsPublishFlow.Grouped |
SendMessageRequest |
Individual SqsPublishResultEntry values after grouping |
SqsPublishFlow.Batch |
IEnumerable<SendMessageRequest> |
A list of SqsPublishResultEntry values for each input batch |
SqsPublishSink.Grouped/Batch accept strings and discard those detailed results. MessageSink, GroupedMessageSink and BatchedMessageSink accept SDK requests. For single-request Default/MessageSink, set each request's QueueUrl: the queueUrl argument does not rewrite that request. String sinks create requests with the supplied URL. Grouped/batch publishing uses the supplied batch queue URL.
Batch results are associated with their original requests by SQS batch entry ID, even when the SDK returns successes in a different order. A partial batch failure fails the stream with SqsBatchException; successful entries may already have been sent. The connector does not retry just the failed entries or undo successful sends. AWS client retries or application retries can duplicate delivery.
The batch path forwards the body, message attributes, message-group ID and deduplication ID. Per-message DelaySeconds and system attributes are not copied into batch entries by this version; use a single-request API or suitable queue settings when those fields matter. Keep batches within SQS limits and do not infer FIFO ordering/deduplication guarantees from standard-queue examples.
Receive, process and delete
SqsSource.Create emits AWS SDK Message objects and materializes NotUsed. Receiving makes messages invisible temporarily; it does not delete or automatically acknowledge them. After successful application processing, pass MessageAction.Delete(message) through an acknowledgment flow or sink.
This complete example processes three messages from the publisher and then completes. It limits batch/buffer size to one; the source can still issue a receive ahead of downstream completion.
using Akka.Actor;
using Akka.Streams;
using Akka.Streams.Dsl;
using Akka.Streams.SQS;
using Amazon;
using Amazon.SQS;
using var client = new AmazonSQSClient(RegionEndpoint.GetBySystemName(
Environment.GetEnvironmentVariable("AWS_REGION") ?? "us-east-1"));
var queueUrl = Environment.GetEnvironmentVariable("SQS_QUEUE_URL")
?? throw new InvalidOperationException("Set SQS_QUEUE_URL.");
var system = ActorSystem.Create("sqs-consumer");
try
{
var settings = SqsSourceSettings.Default.WithWaitTime(TimeSpan.FromSeconds(1))
.WithMaxBatchSize(1).WithMaxBufferSize(1);
await SqsSource.Create(client, queueUrl, settings)
.Take(3)
.Select(message =>
{
Console.WriteLine(message.Body);
return MessageAction.Delete(message);
})
.RunWith(SqsAckSink.Default(client, queueUrl), system.Materializer());
}
finally { await system.Terminate(); }
MessageAction.Ignore leaves the message untouched; it can be received again after its visibility timeout. ChangeVisibility(message, timeout) changes that timeout; zero makes it available again immediately. Use the current receipt handle from the most recent receive. SqsAckFlow.Default emits individual acknowledgment results; Grouped batches deletes/visibility changes and merges the action branches, so output order can differ from input order. Grouped partial failures throw SqsBatchException after some operations may already have succeeded.
Default source settings use a 20-second long poll, batch size 10, buffer size 100 and parallelism one. Configure system/message attributes explicitly with WithAttributes/WithMessageAttributes; use WithVisibilityTimeout to override the queue's receive visibility. WithCloseOnEmptyReceive(true) completes on an empty response; its default is false and it keeps polling. An empty response is not proof that no message can arrive later.
Stream backpressure bounds emitted data, but SDK receives, the source buffer and downstream buffers allow prefetch/in-flight work. Take or cancellation can leave received, undeleted messages invisible until visibility expires. Cancellation does not cancel SDK calls already issued by these stages. Configure bounded client timeouts/polls and manage the borrowed client's lifetime. A client exception normally fails the stream; application supervision/retries need to account for partially completed external effects. Neither a completed stream nor an SQS delete provides an exactly-once transaction with your application work.
Tests
With Docker running, from the repository root:
dotnet test src/AWS/SQS/Akka.Streams.SQS.Tests/Akka.Streams.SQS.Tests.csproj -c Release --framework net10.0
The existing unit tests are retained. Integration tests use Testcontainers.Floci with pinned floci/floci:1.5.13, discovered endpoints, bounded startup and owned cleanup. They compare single/grouped/batch publishing results with native SDK message IDs, and exercise attributes, visibility changes, ignore/delete actions, close-on-empty and missing-queue failures. Held-message controls check both visible and invisible emulator counts so an empty receive alone cannot stand in for deletion. Missing Docker or emulator setup failures fail the suite. Standard-queue emulator tests do not establish AWS IAM/KMS, cloud consistency/scaling, FIFO behavior or production durability.
| 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.SQS (>= 3.7.501.2)
-
net6.0
- Akka.Streams (>= 1.5.74)
- AWSSDK.SQS (>= 3.7.501.2)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Akka.Streams.SQS:
| Package | Downloads |
|---|---|
|
SnD.Sdk
SDK for Sneaks&Data OSS Projects |
|
|
MJ.Akka.EventReactor.SQS
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.5.74 | 127 | 11/13/2026 |
| 1.5.59 | 4,161 | 1/27/2026 |
| 1.5.57 | 828 | 12/23/2025 |
| 1.5.40 | 3,628 | 4/18/2025 |
| 1.5.37 | 6,333 | 1/23/2025 |
| 1.5.33 | 1,879 | 12/26/2024 |
| 1.5.28 | 2,701 | 9/9/2024 |
| 1.5.18 | 11,649 | 3/29/2024 |
| 1.5.15 | 1,832 | 1/11/2024 |
| 1.5.8 | 6,324 | 6/30/2023 |
| 1.5.7 | 5,178 | 5/31/2023 |
| 1.5.0.1 | 1,852 | 3/7/2023 |
| 1.5.0 | 1,910 | 3/3/2023 |
| 1.4.49 | 1,793 | 3/3/2023 |
| 1.0.1-beta4 | 648 | 10/21/2022 |
| 1.0.1-beta3 | 337 | 10/21/2022 |
| 1.0.1-beta2 | 410 | 7/25/2022 |
| 1.0.1-beta1 | 361 | 6/8/2022 |
| 1.0.0-beta9 | 2,735 | 3/17/2022 |
| 1.0.0-beta8 | 402 | 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.