Akka.Persistence.Redis.Hosting
1.5.68
Prefix Reserved
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" />
<PackageReference Include="Akka.Persistence.Redis.Hosting" />
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.68
#tool nuget:?package=Akka.Persistence.Redis.Hosting&version=1.5.68
Akka.Persistence.Redis.Hosting
Akka.Hosting extension methods to add Akka.Persistence.Redis to an ActorSystem
Akka.Persistence.Redis Extension Methods
WithRedisPersistence() Method
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)
Parameters
configurationStringstringConnection string used for database access. Connection string as described here: https://stackexchange.github.io/StackExchange.Redis/Configuration#basic-configuration-strings.
modePersistenceModeDetermines which settings should be added by this method call. Default:
PersistenceMode.BothPersistenceMode.Journal: Only add the journal settingsPersistenceMode.SnapshotStore: Only add the snapshot store settingsPersistenceMode.Both: Add both journal and snapshot store settings
autoInitializeboolShould the Redis store collection be initialized automatically. Default:
falsejournalBuilderAction<AkkaPersistenceJournalBuilder>An Action delegate used to configure an
AkkaPersistenceJournalBuilderinstance. Used to configure health check.snapshotBuilderAction<AkkaPersistenceSnapshotBuilder>An Action delegate used to configure an
AkkaPersistenceSnapshotBuilderinstance. Used to configure health check.journalConfiguratorAction<RedisJournalOptions>An Action delegate to configure a
RedisJournalOptionsinstance.snapshotConfiguratorAction<RedisSnapshotOptions>An Action delegate to configure a
RedisSnapshotOptionsinstance.journalOptionsRedisJournalOptionsAn
RedisJournalOptionsinstance to configure the Redis journal store.snapshotOptionsRedisSnapshotOptionsAn
RedisSnapshotOptionsinstance to configure the Redis snapshot store.
Microsoft.Extensions.Diagnostics.HealthChecks Integration
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.
Built-in Health Checks
All health checks are tagged with akka, persistence, and mongodb for easy filtering.
Configuring Health Checks
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 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.Persistence.Hosting (>= 1.5.68)
- Akka.Persistence.Redis (>= 1.5.68)
- Azure.Identity (>= 1.17.1)
- Microsoft.Azure.StackExchangeRedis (>= 3.3.1)
-
net6.0
- Akka.Persistence.Hosting (>= 1.5.68)
- Akka.Persistence.Redis (>= 1.5.68)
- Azure.Identity (>= 1.17.1)
- Microsoft.Azure.StackExchangeRedis (>= 3.3.1)
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.68 | 123 | 6/1/2026 |
| 1.5.68-beta1 | 95 | 5/13/2026 |
| 1.5.67 | 309 | 4/28/2026 |
| 1.5.59 | 1,175 | 1/27/2026 |
| 1.5.55.1 | 759 | 10/29/2025 |
| 1.5.55 | 251 | 10/27/2025 |
| 1.5.53 | 10,116 | 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`.