Class RedisConnectionFactory

Namespace: redb.Route.Redis
Assembly: redb.Route.Redis.dll

Connection factory for Redis. Register via DI or in the route registry
and reference by name in endpoint URIs (connectionFactory=myFactory).

public sealed class RedisConnectionFactory

Inheritance

Object→RedisConnectionFactory

Properties

AbortOnConnectFail

Abort on connection fail (default: false — allows reconnect).

public bool AbortOnConnectFail { get; set; }

AllowAdmin

Allow admin commands (default: false).

public bool AllowAdmin { get; set; }

AsyncTimeout

Async operation timeout in milliseconds (default: 5000).

public int AsyncTimeout { get; set; }

ChannelPrefix

Channel prefix for Pub/Sub (optional).

public string? ChannelPrefix { get; set; }

CheckCertificateRevocation

Enable certificate revocation checking (default: true).

public bool CheckCertificateRevocation { get; set; }

ClientName

Client name for identification in Redis INFO.

public string ClientName { get; set; }

ConnectionString

Redis connection string (e.g., "localhost:6379" or "host1:6379,host2:6379").

public string ConnectionString { get; set; }

ConnectRetry

Number of connection retries (default: 3).

public int ConnectRetry { get; set; }

ConnectTimeout

Connection timeout in milliseconds (default: 5000).

public int ConnectTimeout { get; set; }

Database

Default database index (default: 0).

public int Database { get; set; }

IncludeDetailInExceptions

Include detailed diagnostics in exceptions.

public bool IncludeDetailInExceptions { get; set; }

IncludePerformanceCountersInExceptions

Include performance counters in exceptions.

public bool IncludePerformanceCountersInExceptions { get; set; }

KeepAlive

Keep-alive interval in seconds (default: 60).

public int KeepAlive { get; set; }

Password

Redis password (optional).

public string? Password { get; set; }

ReconnectRetryPolicy

Reconnect retry policy: "exponential" or "linear" (default: exponential).

public string ReconnectRetryPolicy { get; set; }

ServiceName

Redis Sentinel service name. Required for Sentinel-based HA setups.

public string? ServiceName { get; set; }

Ssl

Enable SSL encryption.

public bool Ssl { get; set; }

SslHost

SSL host for certificate validation.

public string? SslHost { get; set; }

SslProtocols

SSL/TLS protocol versions (e.g. "Tls12", "Tls13"). Default = system default.

public string? SslProtocols { get; set; }

SyncTimeout

Synchronous operation timeout in milliseconds (default: 5000).

public int SyncTimeout { get; set; }

TieBreaker

Tie-breaker key for master detection in multi-master scenarios.

public string? TieBreaker { get; set; }

User

Redis ACL username (Redis 6+). Use together with Password for ACL authentication.

public string? User { get; set; }

Methods

Build()

Creates from this factory's settings.

public ConfigurationOptions Build()