You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: add comprehensive connection pool configuration guide (#217)
- Add detailed Jedis pool configuration documentation
- Include examples for property-based and Java-based configuration
- Document JedisClientConfigurationBuilderCustomizer approach
- Add pool monitoring examples and common configuration scenarios
- Provide imports for all code examples to improve clarity
Copy file name to clipboardExpand all lines: docs/content/modules/ROOT/pages/configuration.adoc
+204-6Lines changed: 204 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,13 +90,15 @@ spring:
90
90
ssl: false
91
91
timeout: 60000 # Connection timeout in milliseconds
92
92
93
-
# Connection pool settings (optional)
94
-
lettuce:
93
+
# Jedis connection pool settings (Redis OM Spring uses Jedis by default)
94
+
jedis:
95
95
pool:
96
-
max-active: 8
97
-
max-idle: 8
98
-
min-idle: 0
99
-
max-wait: -1ms
96
+
enabled: true
97
+
max-active: 8 # Maximum connections in the pool
98
+
max-idle: 8 # Maximum idle connections
99
+
min-idle: 0 # Minimum idle connections
100
+
max-wait: -1ms # Maximum wait time for connection (-1 = indefinite)
101
+
time-between-eviction-runs: 30s # How often to evict idle connections
100
102
----
101
103
102
104
=== Cluster Configuration
@@ -137,6 +139,202 @@ spring:
137
139
138
140
For more details on Redis Sentinel configuration, see the xref:sentinel.adoc[Redis Sentinel Support] page.
139
141
142
+
=== Connection Pool Configuration
143
+
144
+
Redis OM Spring uses Jedis as its Redis client, which provides robust connection pooling capabilities. The pool configuration can be customized through Spring Boot properties:
145
+
146
+
==== Basic Pool Configuration
147
+
148
+
[source,yaml]
149
+
----
150
+
spring:
151
+
data:
152
+
redis:
153
+
jedis:
154
+
pool:
155
+
enabled: true # Enable connection pooling
156
+
max-active: 8 # Maximum number of connections in the pool
157
+
max-idle: 8 # Maximum number of idle connections
158
+
min-idle: 0 # Minimum number of idle connections
159
+
max-wait: -1ms # Maximum wait time for a connection (-1 = indefinite)
160
+
161
+
# Eviction configuration
162
+
time-between-eviction-runs: 30s # How often to run the eviction thread
163
+
min-evictable-idle-time: 60s # Minimum time before idle connections can be evicted
164
+
num-tests-per-eviction-run: -1 # Number of connections to test per eviction run (-1 = test all)
165
+
166
+
# Connection validation
167
+
test-on-borrow: false # Test connection before borrowing from pool
168
+
test-on-return: false # Test connection when returning to pool
169
+
test-while-idle: true # Test connections while idle
170
+
----
171
+
172
+
==== Advanced Pool Configuration with Java Config
173
+
174
+
For more advanced configuration scenarios, you can create a custom `JedisConnectionFactory` bean:
0 commit comments