Skip to content

Springboot Lettuce Properties

Lettuce Standalone

# Select Redis database index (0-15)
spring.redis.database=0

# Redis server host address
spring.redis.host=146.56.223.148

# Redis server port
spring.redis.port=6379

# Redis access password (quotes required for special characters)
spring.redis.password=#pwd@redis

# Command execution timeout in milliseconds
spring.redis.timeout=2000

# Client implementation type (jedis/lettuce)
spring.redis.client-type=lettuce

# Lettuce 
# Lettuce shutdown timeout
spring.redis.lettuce.shutdown-timeout=100ms

# Lettuce Pool(Optional)
# ...

Lettuce Standalone Optional

# Redis connection URL (format: redis://[user:password@]host:port[/database])
spring.redis.url=146.56.223.148:6379

# Redis username (Redis 6+ ACL)
spring.redis.username=default

# Connection establishment timeout in milliseconds
spring.redis.connect-timeout=5000

# Client name identifier (for server-side monitoring)
spring.redis.client-name=""

# Enable SSL encrypted connection
spring.redis.ssl=false

# Lettuce Pool (Optional)
# Enable Lettuce connection pool
spring.redis.lettuce.pool.enabled=true

# Maximum active connections in pool
spring.redis.lettuce.pool.max-active=20

# Maximum idle connections in pool
spring.redis.lettuce.pool.max-idle=10

# Minimum idle connections in pool
spring.redis.lettuce.pool.min-idle=2

# Max wait time to get a connection (ms)
spring.redis.lettuce.pool.max-wait=1000ms

# Custom Configuration
# Validate connection when borrowing from pool
spring.redis.test-on-borrow=true

Lettuce Sentinel

# Select Redis database index (0-15)
spring.redis.database=0

# Redis access password (quotes required for special characters)
spring.redis.password=#pwd@redis

# Command execution timeout in milliseconds
spring.redis.timeout=2000

# Client implementation type (jedis/lettuce)
spring.redis.client-type=lettuce

# Sentinel
# Master node name in Sentinel mode
spring.redis.sentinel.master=mymaster

# Sentinel node addresses (host:port, comma-separated)
spring.redis.sentinel.nodes=127.0.0.1:26379,127.0.0.2:26379,127.0.0.3:26379

# Lettuce
# Lettuce shutdown timeout
spring.redis.lettuce.shutdown-timeout=100ms

# Lettuce Pool(Optional)
# ...

Lettuce Sentinel Optional

# Redis username (Redis 6+ ACL)
spring.redis.username=default

# Connection establishment timeout in milliseconds
spring.redis.connect-timeout=5000

# Client name identifier (for server-side monitoring)
spring.redis.client-name=""

# Enable SSL encrypted connection
spring.redis.ssl=false

# Custom Configuration
# Validate connection when borrowing from pool
spring.redis.test-on-borrow=true

# Lettuce Pool (Optional)
# Enable Lettuce connection pool
spring.redis.lettuce.pool.enabled=true

# Maximum active connections in pool
spring.redis.lettuce.pool.max-active=20

# Maximum idle connections in pool
spring.redis.lettuce.pool.max-idle=10

# Minimum idle connections in pool
spring.redis.lettuce.pool.min-idle=2

# Max wait time to get a connection (ms)
spring.redis.lettuce.pool.max-wait=1000ms

Lettuce Cluster

# Redis access password (quotes required for special characters)
spring.redis.password=#pwd@redis

# Command execution timeout in milliseconds
spring.redis.timeout=2000

# Client implementation type (jedis/lettuce)
spring.redis.client-type=lettuce

# Cluster
# Maximum number of redirects to follow when executing commands.
spring.redis.cluster.max-redirects=3

# Initial cluster node addresses (host:port, comma-separated)
spring.redis.cluster.nodes=127.0.0.1:6379,127.0.0.2:6379,127.0.0.3:6379

# Lettuce
# Lettuce shutdown timeout
spring.redis.lettuce.shutdown-timeout=100ms

# Lettuce cluster topology refresh configuration
# Enable adaptive cluster topology refresh
spring.redis.lettuce.cluster.refresh.adaptive=true

# Periodic cluster topology refresh interval
spring.redis.lettuce.cluster.refresh.period=30s

Lettuce Cluster Optional

# Redis username (Redis 6+ ACL)
spring.redis.username=default

# Connection establishment timeout in milliseconds
spring.redis.connect-timeout=5000

# Client name identifier (for server-side monitoring)
spring.redis.client-name=""

# Enable SSL encrypted connection
spring.redis.ssl=false

# Custom Configuration
# Validate connection when borrowing from pool
spring.redis.test-on-borrow=true

# Lettuce Pool (Optional)
# Enable Lettuce connection pool
spring.redis.lettuce.pool.enabled=true

# Maximum active connections in pool
spring.redis.lettuce.pool.max-active=20

# Maximum idle connections in pool
spring.redis.lettuce.pool.max-idle=10

# Minimum idle connections in pool
spring.redis.lettuce.pool.min-idle=2

# Max wait time to get a connection (ms)
spring.redis.lettuce.pool.max-wait=1000ms