diff --git a/src/core/StackExchange.Redis.Extensions.Core/Configuration/RedisConfiguration.cs b/src/core/StackExchange.Redis.Extensions.Core/Configuration/RedisConfiguration.cs index 6b44603..ce0175c 100644 --- a/src/core/StackExchange.Redis.Extensions.Core/Configuration/RedisConfiguration.cs +++ b/src/core/StackExchange.Redis.Extensions.Core/Configuration/RedisConfiguration.cs @@ -36,6 +36,7 @@ public class RedisConfiguration private string? configurationChannel; private string? connectionString; private string? serviceName; + private bool disableSentinelCommandmapper; private int? connectRetry; private SslProtocols? sslProtocols; private Func? profilingSessionProvider; @@ -116,6 +117,20 @@ public string? ServiceName } } + /// + /// Gets or sets the disableSentinelCommandmapper used in case of Sentinel. + /// + public bool DisableSentinelCommandmapper + { + get => disableSentinelCommandmapper; + + set + { + disableSentinelCommandmapper = value; + ResetConfigurationOptions(); + } + } + /// /// Gets a value indicating whether get a boolean value that indicates if the cluster is configured for sentinel or not /// @@ -449,7 +464,11 @@ public ConfigurationOptions ConfigurationOptions if (IsSentinelCluster) { newOptions.ServiceName = ServiceName; - newOptions.CommandMap = CommandMap.Sentinel; + + if (!DisableSentinelCommandmapper) + newOptions.CommandMap = CommandMap.Sentinel; + else + newOptions.CommandMap = CommandMap.SSDB; } foreach (var redisHost in Hosts)