![]() |
VOOZH | about |
dotnet add package Akka.Persistence.Redis.Hosting --version 1.5.68
NuGet\Install-Package Akka.Persistence.Redis.Hosting -Version 1.5.68
<PackageReference Include="Akka.Persistence.Redis.Hosting" Version="1.5.68" />
<PackageVersion Include="Akka.Persistence.Redis.Hosting" Version="1.5.68" />Directory.Packages.props
<PackageReference Include="Akka.Persistence.Redis.Hosting" />Project file
paket add Akka.Persistence.Redis.Hosting --version 1.5.68
#r "nuget: Akka.Persistence.Redis.Hosting, 1.5.68"
#:package Akka.Persistence.Redis.Hosting@1.5.68
#addin nuget:?package=Akka.Persistence.Redis.Hosting&version=1.5.68Install as a Cake Addin
#tool nuget:?package=Akka.Persistence.Redis.Hosting&version=1.5.68Install as a Cake Tool
Akka.Hosting extension methods to add Akka.Persistence.Redis to an ActorSystem
public static AkkaConfigurationBuilder WithRedisPersistence(
this AkkaConfigurationBuilder builder,
string configurationString,
PersistenceMode mode = PersistenceMode.Both,
bool autoInitialize = true,
Action<AkkaPersistenceJournalBuilder>? journalBuilder = null,
Action<AkkaPersistenceSnapshotBuilder>? snapshotBuilder = null,
string pluginIdentifier = "Redis",
bool isDefaultPlugin = true);
public static AkkaConfigurationBuilder WithRedisPersistence(
this AkkaConfigurationBuilder builder,
Action<RedisJournalOptions>? journalOptionConfigurator = null,
Action<RedisSnapshotOptions>? snapshotOptionConfigurator = null,
bool isDefaultPlugin = true)
public static AkkaConfigurationBuilder WithRedisPersistence(
this AkkaConfigurationBuilder builder,
RedisJournalOptions? journalOptions = null,
RedisSnapshotOptions? snapshotOptions = null
Action<AkkaPersistenceJournalBuilder>? journalBuilder = null,
Action<AkkaPersistenceSnapshotBuilder>? snapshotBuilder = null)
configurationString string
Connection string used for database access. Connection string as described here: https://stackexchange.github.io/StackExchange.Redis/Configuration#basic-configuration-strings.
mode PersistenceMode
Determines which settings should be added by this method call. Default: PersistenceMode.Both
PersistenceMode.Journal: Only add the journal settingsPersistenceMode.SnapshotStore: Only add the snapshot store settingsPersistenceMode.Both: Add both journal and snapshot store settingsautoInitialize bool
Should the Redis store collection be initialized automatically. Default: false
journalBuilder Action<AkkaPersistenceJournalBuilder>
An Action delegate used to configure an AkkaPersistenceJournalBuilder instance. Used to configure health check.
snapshotBuilder Action<AkkaPersistenceSnapshotBuilder>
An Action delegate used to configure an AkkaPersistenceSnapshotBuilder instance. Used to configure health check.
journalConfigurator Action<RedisJournalOptions>
An Action delegate to configure a RedisJournalOptions instance.
snapshotConfigurator Action<RedisSnapshotOptions>
An Action delegate to configure a RedisSnapshotOptions instance.
journalOptions RedisJournalOptions
An RedisJournalOptions instance to configure the Redis journal store.
snapshotOptions RedisSnapshotOptions
An RedisSnapshotOptions instance to configure the Redis snapshot store.
Akka.Persistence.Redis.Hosting includes built-in health check support for Redis persistence plugins through the WithHealthCheck() extension methods. These health checks integrate with Microsoft.Extensions.Diagnostics.HealthChecks to monitor the health of your Redis journal and snapshot stores.
All health checks are tagged with akka, persistence, and mongodb for easy filtering.
You can add health checks when configuring Redis persistence using the WithHealthCheck() method:
builder
.WithRedisPersistence(
journalOptions: new RedisJournalOptions
{
ConfigurationString = "your-redis-connection-string",
},
snapshotOptions: new RedisSnapshotOptions
{
ConfigurationString = "your-redis-connection-string",
},
journalBuilder: journal => journal.WithHealthCheck(HealthStatus.Degraded),
snapshotBuilder: snapshot.WithHealthCheck(HealthStatus.Degraded));
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 is compatible. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.5.68 | 123 | 6/1/2026 |
| 1.5.68-beta1 | 95 | 5/13/2026 |
| 1.5.67 | 309 | 4/28/2026 |
| 1.5.59 | 1,178 | 1/27/2026 |
| 1.5.55.1 | 759 | 10/29/2025 |
| 1.5.55 | 251 | 10/27/2025 |
| 1.5.53 | 10,221 | 10/15/2025 |
| 1.5.42 | 6,146 | 5/22/2025 |
| 1.5.37 | 1,019 | 1/23/2025 |
| 1.5.30 | 4,372 | 10/4/2024 |
| 1.5.29 | 276 | 10/2/2024 |
| 1.5.24 | 4,399 | 6/11/2024 |
| 1.5.13 | 7,512 | 10/6/2023 |
This is the stable release of the post-1.5.67 Redis hardening work.
**Behavior Changes / Compatibility Notes**
* Removed the legacy query subscriber notification protocol (`ISubscriptionCommand`, `SubscribeNewEvents`, and `NewEventAppended`). Live persistence queries now rely exclusively on polling via `akka.persistence.query.journal.redis.refresh-interval`. This removes a dead actor-local optimization that could leak subscribers and race with journal writes. Users that need lower live-query latency can reduce the Redis query `refresh-interval`.
* Redis journal and snapshot-store connections are now created during plugin actor construction instead of lazily on first database access. This fixes a `ConnectionMultiplexer` lifecycle leak and allows plugin-owned connections to be disposed when the actor stops, but connection failures may now surface earlier during plugin startup.
* Akka.Hosting Redis configuration now validates missing connection sources earlier. Each configured Redis journal or snapshot store must have either a HOCON connection string or a matching `RedisConnectionMultiplexerSetup` entry.
**Improvements**
* Added `WithAzureRedisPersistence(...)` for Azure Managed Redis and Azure Cache for Redis using Entra ID / Managed Identity authentication. The helper configures TLS, RESP3, `SslHost`, and token authentication via `Microsoft.Azure.StackExchangeRedis`.
* Added plugin-scoped `RedisConnectionMultiplexerSetup` support for caller-supplied multiplexers and multiplexer factories. Setup entries are keyed by Redis plugin id, so one Redis plugin's injected connection source does not override another plugin's HOCON connection string.
* Added explicit Redis connection ownership semantics via `RedisConnectionOwnership`: caller-owned, plugin-owned, and actor-system-owned.
* Updated Redis health checks so setup-backed plugins reuse the configured connection source, while HOCON-only plugins open a temporary multiplexer for the probe and dispose it after `PING`.
* Fixed snapshot-only Akka.Hosting configuration so Redis default HOCON is still loaded when only the snapshot store is configured.
* Fixed `DeferAsync` with an empty write batch, which previously could throw from `ContinueWhenAll`.
* Added `CommandFlags.DemandMaster` to Redis write operations as defense-in-depth for primary-only writes.
* Removed the `ConnectionMultiplexer` leak in journal and snapshot actors by tracking connection ownership and disposing plugin-owned connections from `PostStop`.
* Reworked Redis test fixtures to use Testcontainers and hardened cluster readiness / CI failure behavior.
* Added automatic Redis Cluster topology refresh on the "Command cannot be issued to a replica" error that surfaces after a failover demotes a primary. The journal and snapshot store catch this case, fire `IConnectionMultiplexer.ConfigureAsync()` in the background, and rethrow so the existing circuit breaker handles retry timing. Detection uses `IServer.IsReplica` against the endpoint in `Exception.Data["redis-server"]`, with the literal message as a fallback when `ConfigurationOptions.IncludeDetailInExceptions = false`.
* Added a new "Running against Redis Cluster" section to `README.md` covering the recommended SE.Redis connection string, Akka.Persistence circuit-breaker tuning, the `Ask` timeout vs `call-timeout` rule, and which cluster-failover failure modes are handled by StackExchange.Redis vs the plugin.
* Added commented circuit-breaker tuning guidance under the journal and snapshot-store sections of `reference.conf`. No HOCON defaults change.
**Dependencies**
* Upgraded `StackExchange.Redis` to 2.12.14.
* Added `Microsoft.Azure.StackExchangeRedis` 3.3.1 and `Azure.Identity` 1.17.1 to `Akka.Persistence.Redis.Hosting`.
* Updated test/build dependencies including `Microsoft.NET.Test.Sdk`, `coverlet.collector`, `Testcontainers`, and `Microsoft.SourceLink.GitHub`.