Flowly.MessageStreams 1.5.0

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

Flowly.MessageStreams

Built-in position persistence for Flowly message streams (MessageStreamHandler<T> / IMessageRecorder). Gives MessageStreamCheckpoint<T> a ready-to-use, database-backed implementation so a stream reader survives restarts without hand-writing storage code.

Also install a database backend: Flowly.MessageStreams.SqlServer, Flowly.MessageStreams.Postgres, or Flowly.MessageStreams.SQLite.

Quick start

builder.UseRabbitMq("RabbitMQ");
builder.AddSqlServerMessageStreamPersistence("MsgStreamDb");

builder.AddMessageStreamHandler<MyMessage, MyMessageHandler>();
builder.UseMessageStreamCheckpoint<MyMessage>();

UseMessageStreamCheckpoint<TMessage>() can be called before or after AddMessageStreamHandler. Position persistence works with every stream transport except InMemory — InMemory-backed streams throw InvalidOperationException if you try to use a built-in (or hand-rolled) checkpoint against them, since the in-process log has no cross-restart persistence of its own. The stores contain no transport-specific code: a position is keyed by consumer name, queue name (the event hub name on Azure Event Hubs) and partition, and it is the stream offset of the last processed message, which on Azure Event Hubs is the event's sequence number within its partition.

Multiple, named persistence stores

builder.AddPostgresMessageStreamPersistence("MsgStreamDb");
builder.AddSqlServerMessageStreamPersistence("MsgStreamDb", name: "This One");

builder.AddMessageStreamHandler<MyMessage, MyMessageHandler>();
builder.UseMessageStreamCheckpoint<MyMessage>("This One");

The first unnamed Add<Provider>MessageStreamPersistence call becomes the default store, used when UseMessageStreamCheckpoint<T>() is called without a name. A second unnamed registration throws — give it an explicit name: instead.

First-run position

When a reader has no stored position, Flowly resolves StartPosition.Last() or StartPosition.Timestamp(...) to a concrete offset and stores it before the handler starts consuming (where the transport can resolve it: RabbitMQ, and Azure Event Hubs for Last() and for a Timestamp(...) later than the last enqueued event), so a restart before the first batch does not move the position and messages published while the process was down are delivered. A row can therefore hold the position -1, meaning "start at offset 0". First() and Offset(n) are not stored up front. If the offset cannot be resolved or stored, a warning is logged and the position is stored after the first processed batch instead.

Custom (hand-rolled) checkpoints

You can still implement MessageStreamCheckpoint<T> yourself against any storage you choose:

builder.AddMessageStreamHandler<MyMessage, MyMessageHandler>();
builder.AddMessageStreamCheckpoint<MyMessageCheckpoint>();

AddMessageStreamCheckpoint<TCheckpoint>() is sugar over services.AddSingleton<MessageStreamCheckpoint<TMessage>, TCheckpoint>() — it infers the message type from TCheckpoint's base class. A hand-rolled checkpoint must accept a SaveStreamPosition call without a processed batch (MessageStreamCheckpointSaveContext.IsBootstrapSeed is true) and a negative position (-1), and must return a stored -1 as -1 rather than null. A save with IsBootstrapSeed = true must write only when no position is stored yet for the reader and never overwrite one, as one atomic conditional operation; a save without the flag always overwrites. The built-in EF Core store does this with an update that requires an empty position and an insert whose unique key conflict means a position is already stored.

Migrations

By default, a hosted service applies pending EF Core migrations at startup (enableMigrations: true, the default on every Add<Provider>MessageStreamPersistence overload). To generate an idempotent SQL script instead — for teams that apply schema changes during deployment rather than at app startup — run the standard EF Core tooling against the provider package you're using, e.g.:

dotnet ef migrations script --idempotent --project Flowly.MessageStreams.SqlServer --output migrate.sql

Operational tooling

See the flowly message-stream list-checkpoints / reset-checkpoint commands in Flowly.Tool, and the Flowly Management API (Flowly.ManagementApi) for resetting a stream's position from outside the running process — useful when replaying messages after an integration issue.

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 (4)

Showing the top 4 NuGet packages that depend on Flowly.MessageStreams:

Package Downloads
Flowly.ManagementApi

Opt-in operational HTTP surface for Flowly — a minimal, machine-oriented management API (no UI), independent of Flowly.Dashboard. Ships message stream checkpoint list/reset, message stream partition list/resume (halted partitions) and dead letter list/requeue/discard; new features register additional IFlowlyManagementAction implementations.

Flowly.MessageStreams.SQLite

SQLite backend for Flowly message stream checkpoint persistence.

Flowly.MessageStreams.Postgres

PostgreSQL backend for Flowly message stream checkpoint persistence.

Flowly.MessageStreams.SqlServer

SQL Server backend for Flowly message stream checkpoint persistence.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.5.0 131 11/20/2026