Akka.Streams.Kinesis 1.5.74

Prefix Reserved
dotnet add package Akka.Streams.Kinesis --version 1.5.74
                    
NuGet\Install-Package Akka.Streams.Kinesis -Version 1.5.74
                    
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="Akka.Streams.Kinesis" Version="1.5.74" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Akka.Streams.Kinesis" Version="1.5.74" />
                    
Directory.Packages.props
<PackageReference Include="Akka.Streams.Kinesis" />
                    
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 Akka.Streams.Kinesis --version 1.5.74
                    
#r "nuget: Akka.Streams.Kinesis, 1.5.74"
                    
#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 Akka.Streams.Kinesis@1.5.74
                    
#: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=Akka.Streams.Kinesis&version=1.5.74
                    
Install as a Cake Addin
#tool nuget:?package=Akka.Streams.Kinesis&version=1.5.74
                    
Install as a Cake Tool

Akka.Streams.Kinesis

NuGet version NuGet downloads

Amazon Kinesis Data Streams publishing and single-shard polling for Akka.NET Streams. The package uses AWSSDK.Kinesis 4.x and targets .NET Standard 2.0 and .NET 6. The Firehose namespace contains public empty placeholders; it does not implement a Firehose connector.

dotnet add package Akka.Streams.Kinesis

Provision a stream separately. Set KINESIS_STREAM_NAME; the examples use the SDK's credential discovery and AWS_REGION (default us-east-1). Grant the appropriate stream permissions. Each materialization calls the supplied client factory and owns/disposes its client, including source completion, failure and cancellation. Return a new client each time; do not return a shared client you intend to reuse elsewhere.

Publish and retain sequence numbers

KinesisFlow.Create accepts SDK PutRecordsRequestEntry values and emits successful PutRecordsResultEntry values. ByPartitionAndBytes accepts (string partitionKey, ByteString data); ByPartitionAndData accepts (string partitionKey, MemoryStream data). Each flow materializes NotUsed; combine it with a downstream sink to observe completion.

using Akka.Actor;
using Akka.IO;
using Akka.Streams;
using Akka.Streams.Dsl;
using Akka.Streams.Kinesis;
using Amazon;
using Amazon.Kinesis;
using Amazon.Kinesis.Model;

var name = Environment.GetEnvironmentVariable("KINESIS_STREAM_NAME")
    ?? throw new InvalidOperationException("Set KINESIS_STREAM_NAME.");
var region = RegionEndpoint.GetBySystemName(Environment.GetEnvironmentVariable("AWS_REGION") ?? "us-east-1");
var system = ActorSystem.Create("kinesis-publisher");
try
{
    var results = await Source.From(new[] { "first", "second", "third" })
        .Select(payload => ("application-key", ByteString.FromString(payload)))
        .Via(KinesisFlow.ByPartitionAndBytes(name, client: () => new AmazonKinesisClient(region)))
        .RunWith(Sink.Seq<PutRecordsResultEntry>(), system.Materializer());
    foreach (var result in results)
        Console.WriteLine($"{result.ShardId}: {result.SequenceNumber}");
}
finally { await system.Terminate(); }

KinesisSink.Create and its tuple variants discard publication responses and materialize NotUsed, not a completion task. Use a flow followed by Sink.Ignore<PutRecordsResultEntry>() when completion/failure needs to be awaited.

The default flow settings use parallelism two, maximum batch size 500, five retries, a 500 ms initial exponential backoff, and shaping budgets of 1,000 records/second and 1,000,000 estimated bytes/second. Configure a settings instance explicitly for your workload. The existing setter is named WithPRetryInitialTimeout.

The byte estimate currently uses PartitionKey.Length + Data.Position; it does not measure UTF-8 key bytes plus stream length. Raw streams positioned at zero can therefore undercount payload bytes. These budgets are not a guarantee that every shard meets current AWS limits. Keep requests within service limits and validate real shard distribution/throughput for your deployment.

Partial PutRecords successes are emitted and failed entries are retried independently. Concurrent retry jobs are retained separately. Retries can reorder results relative to original input and can repeat external effects; there is no exactly-once delivery guarantee. Exponential backoff doubles the initial delay by attempt; the Linear strategy uses initial delay multiplied by attempt count. Exhausting retries fails with PublishingRecordsException, whose Attempt and Errors expose the attempted requests/results. Whole-request SDK failures fail the stream rather than using this per-record retry path; SDK client retries are a separate policy.

Read a shard

KinesisSource.Basic emits SDK Record values from one configured shard and materializes NotUsed. Discover shard IDs with the SDK; merge multiple sources explicitly if needed. This example reads three records from the beginning of a known shard. Set KINESIS_SHARD_ID as well as the stream name.

using Akka.Actor;
using Akka.Streams;
using Akka.Streams.Dsl;
using Akka.Streams.Kinesis;
using Amazon;
using Amazon.Kinesis;

var name = Environment.GetEnvironmentVariable("KINESIS_STREAM_NAME")
    ?? throw new InvalidOperationException("Set KINESIS_STREAM_NAME.");
var shard = Environment.GetEnvironmentVariable("KINESIS_SHARD_ID")
    ?? throw new InvalidOperationException("Set KINESIS_SHARD_ID.");
var region = RegionEndpoint.GetBySystemName(Environment.GetEnvironmentVariable("AWS_REGION") ?? "us-east-1");
var system = ActorSystem.Create("kinesis-reader");
try
{
    var settings = ShardSettings.Create(name, shard).WithShardIteratorType(ShardIteratorType.TRIM_HORIZON);
    var records = await KinesisSource.Basic(settings, () => new AmazonKinesisClient(region))
        .Take(3).RunWith(Sink.Seq<Amazon.Kinesis.Model.Record>(), system.Materializer());
    foreach (var record in records)
        Console.WriteLine(System.Text.Encoding.UTF8.GetString(record.Data.ToArray()));
}
finally { await system.Terminate(); }

Default shard settings start at LATEST, poll empty responses after one second and request up to 500 records. WithLimit accepts 1–10,000. A source can fetch/buffer before downstream requests and fetch the next batch after draining its buffer. Backpressure controls emission, not a promise of zero speculative SDK work. A terminal response with no next iterator drains all its records before completion; an empty terminal response completes immediately.

Checkpointing, shard discovery/resharding and automatic recovery from expired iterators are not implemented. Save sequence numbers after successful application processing. To restart at/after a saved sequence, set WithStartingSequenceNumber(sequence) before WithShardIteratorType(AT_SEQUENCE_NUMBER/AFTER_SEQUENCE_NUMBER); timestamp iterators similarly need WithAtTimestamp before their iterator type. SDK errors fail the source. Calls already issued do not receive a stream cancellation token; shutdown disposes the owned SDK client, so outstanding requests may be interrupted.

Tests

With Docker running, from the repository root:

dotnet test src/AWS/Kinesis/Akka.Streams.Kinesis.Tests/Akka.Streams.Kinesis.Tests.csproj -c Release --framework net10.0

The retained unit tests and lifecycle regressions cover demand, terminal-batch draining, finite publication, concurrent failed-batch retries and owned-client disposal. Integration uses Testcontainers.Floci with pinned floci/floci:1.5.13, discovered endpoints, bounded readiness and owned cleanup. Native SDK peers verify all three publishing modes, exact UTF-8 data/sequence numbers, trim/at/after source positions, sink completion and missing-stream failure.

Floci represents a missing-stream PutRecords as per-entry InternalFailure, unlike AWS's request-level error; a native positive control characterizes that shape before asserting the connector's retry-exhaustion result. Tests use one shard and do not claim AWS MD5 partition placement: Floci's shard-selection algorithm differs. They do not prove cloud IAM/KMS, real throughput, resharding, Firehose behavior or production durability. Missing Docker or emulator startup failures fail the suite.

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

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.5.74 110 11/13/2026
1.5.59 537 1/27/2026
1.5.57 264 12/23/2025
1.5.40 1,384 4/18/2025
1.5.37 4,290 1/23/2025
1.5.33 559 12/26/2024
1.5.28 630 9/9/2024
1.5.18 339 3/29/2024
1.5.15 364 1/11/2024
1.5.8 505 6/30/2023
1.5.7 423 5/31/2023
1.5.0.1 496 3/7/2023
1.5.0 476 3/3/2023
1.4.49 478 3/3/2023
1.0.1-beta4 717 10/21/2022
1.0.1-beta3 396 10/21/2022
1.0.1-beta2 421 7/25/2022
1.0.1-beta1 421 6/8/2022
1.0.0-beta9 819 3/17/2022
1.0.0-beta8 493 12/21/2021
Loading failed

* 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.