Introduce Predicate<T extends StatefulConnection>
to ConnectionPoolSupport
to customize pooled connection validation
#3081
Labels
for: external-project
For an external project and not something we can fix
status: waiting-for-triage
Feature Request
Is your feature request related to a problem? Please describe
It would be good to customize how pooled connections are validated. Out of the discussion at spring-projects/spring-data-redis#3067 (comment) (which boils down to defunct connections that end up with timeouts as the remote peer isn't responsive) it would be neat to customize the connection validation. Right now,
RedisPooledObjectFactory.validateObject(…)
performsisOpen
validation.Describe the solution you'd like
By accepting a functional interface returning a
boolean
flag, it would be possible that callers provide their own validation function. Having another overload ofConnectionPoolSupport.createGenericObjectPool(…)
could accept either aPredicate
or, better an argument object that encapsulatesPredicate isValid
andboolean wrapConnections
.The text was updated successfully, but these errors were encountered: